[WebLayer] Make CaptivePortalService available
In preparation for sharing //chrome's SSLErrorHandler implementation, this CL makes CaptivePortalService available in WebLayer by adding a KeyedServiceFactory for it. //chrome's SSLErrorHandler requires a CaptivePortalService when captive portal detection is enabled (which it is on desktop platforms, i.e., Linux). The factory is modeled after that from //chrome, with a difference for the //weblayer environment: - The PrefService is passed via user_prefs::UserPrefs::Get() rather than via Profile::GetPrefs(). //weblayer's BrowserContextImpl has no getter for the PrefService, and as that getter is just a synonym for user_prefs::UserPrefs::Get() in //chrome, I see no reason to add it here. Note that this CL (and the bringup of support for Chrome's captive portal detection in WebLayer) will have no impact on Android, where Chrome's captive portal detection service is not enabled as SSLErrorHandler relies on the OS support. As this is the first instance of a KeyedServiceFactory in //weblayer, this CL also brings up the KeyedServiceFactory infrastructure in the //weblayer embedder. Bug: 1030692 Change-Id: Ic24c8a003f53598f9dd08f0da0ac87869398074f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2022671Reviewed-by:Evan Stade <estade@chromium.org> Commit-Queue: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/master@{#736777}
Showing
Please register or sign in to comment