ios/chrome/browser/intelligence/bwg/model/README.md
Last updated: May 2026
This directory contains the core business logic, data models, tab helpers, browser agents, and backend service bridges for the Gemini (BWG) feature integration on Chrome for iOS.
Due to the comprehensive integration of Gemini, the components are categorized into distinct logical subsystems:
BrowserUserData) managing the presentation of the Gemini UI overlay ("floaty"). It monitors scroll and keyboard events to temporarily hide/show the overlay, handles user preferences, and constructs the active session configuration.web::WebStateObserver & web::WebStateUserData) that governs the Gemini context for a single tab. It monitors navigation, page loading, title settings, and favicon changes, coordinates with PageContextWrapper to package page data, and implements the zero-state suggestion chips pipeline.optimization_guide::proto::PageContext objects. Implements custom getters with "consume-on-read" semantics, moving ownership of the proto context exactly once to the consumer.GeminiSessionDelegate) into actual Chrome systems, mapping unique client IDs back to active WebStates, updating background session storage, and logging telemetry.actor::ActorService.base::BarrierCallback.GeminiTabHelper pipeline.UIImagePickerController to take pictures for attachment within Gemini.UrlLoadingBrowserAgent to load hyperlinks clicked inside the Gemini UI in new, same, or background tabs.All components in this folder are covered by specialized unit test suites in the main ios_chrome_unittests target:
gemini_browser_agent_unittest.mmgemini_tab_helper_unittest.mmgemini_page_context_unittest.mmgemini_session_handler_unittest.mmgemini_actuation_handler_unittest.mmgemini_camera_handler_unittest.mmgemini_link_opening_handler_unittest.mmgemini_page_state_change_handler_unittest.mmgemini_suggestion_handler_unittest.mmgemini_view_state_change_handler_unittest.mmgemini_configuration_unittest.mmgemini_service_factory_unittest.mmgemini_service_impl_unittest.mmbwg_snapshot_utils_unittest.mm