Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: blimp/engine/app/blimp_content_browser_client.cc

Issue 2098553002: Geolocation: extract ContentBrowserClient methods specific to Geolocation into a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing to ContentBrowserClient::GetGeolocationServiceOverrides and impl'd in the 6 impl's. Unitte… Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/engine/app/blimp_content_browser_client.cc
diff --git a/blimp/engine/app/blimp_content_browser_client.cc b/blimp/engine/app/blimp_content_browser_client.cc
index 196006aff1506f73d4cff6c81123130ee596b650..5e9917800b822efbc28bed8a10cdb4400decfe6e 100644
--- a/blimp/engine/app/blimp_content_browser_client.cc
+++ b/blimp/engine/app/blimp_content_browser_client.cc
@@ -11,6 +11,22 @@
namespace blimp {
namespace engine {
+namespace {
+// A provider of services needed by Geolocation.
+class BlimpGeolocationServiceOverrides
+ : public content::GeolocationProvider::ServiceOverrides {
+ public:
+ bool UseNetworkLocationProviders() override { return false; }
+
+ content::LocationProvider* OverrideSystemLocationProvider() {
+ if (!location_provider_)
+ location_provider_ = base::WrapUnique(new BlimpLocationProvider());
+ return location_provider_.get();
+ }
+};
+
+} // anonymous namespace
+
BlimpContentBrowserClient::BlimpContentBrowserClient() {}
BlimpContentBrowserClient::~BlimpContentBrowserClient() {}
@@ -39,16 +55,9 @@ BlimpBrowserContext* BlimpContentBrowserClient::GetBrowserContext() {
return blimp_browser_main_parts_->GetBrowserContext();
}
-content::LocationProvider*
-BlimpContentBrowserClient::OverrideSystemLocationProvider() {
- if (!location_provider_) {
- location_provider_ = base::WrapUnique(new BlimpLocationProvider());
- }
- return location_provider_.get();
-}
-
-bool BlimpContentBrowserClient::UseNetworkLocationProviders() {
- return false;
+content::GeolocationProvider::ServiceOverrides*
+ ChromeContentBrowserClient::GetGeolocationServiceOverrides() {
+ return new BlimpGeolocationServiceOverrides();
}
void BlimpContentBrowserClient::RegisterRenderProcessMojoServices(

Powered by Google App Engine
This is Rietveld 408576698