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

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: Added a TODO 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
« no previous file with comments | « blimp/engine/app/blimp_content_browser_client.h ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3c6ab5b12f0cbca56624ccd03df1c0253b746df6..18999b79683092bdb7db4f44f2fbe1e4b6c173c9 100644
--- a/blimp/engine/app/blimp_content_browser_client.cc
+++ b/blimp/engine/app/blimp_content_browser_client.cc
@@ -5,12 +5,35 @@
#include "blimp/engine/app/blimp_content_browser_client.h"
#include "blimp/engine/app/blimp_browser_main_parts.h"
#include "blimp/engine/app/settings_manager.h"
+#include "blimp/engine/feature/geolocation/blimp_location_provider.h"
#include "blimp/engine/mojo/blob_channel_service.h"
#include "services/shell/public/cpp/interface_registry.h"
namespace blimp {
namespace engine {
+namespace {
+// A provider of services needed by Geolocation.
+class BlimpGeolocationDelegate : public content::GeolocationProvider::Delegate {
+ public:
+ BlimpGeolocationDelegate() = default;
+
+ bool UseNetworkLocationProviders() final { return false; }
+
+ content::LocationProvider* OverrideSystemLocationProvider() final {
+ if (!location_provider_)
+ location_provider_ = base::WrapUnique(new BlimpLocationProvider());
+ return location_provider_.get();
+ }
+
+ private:
+ std::unique_ptr<BlimpLocationProvider> location_provider_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpGeolocationDelegate);
+};
+
+} // anonymous namespace
+
BlimpContentBrowserClient::BlimpContentBrowserClient() {}
BlimpContentBrowserClient::~BlimpContentBrowserClient() {}
@@ -39,16 +62,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::Delegate*
+BlimpContentBrowserClient::CreateGeolocationDelegate() {
+ return new BlimpGeolocationDelegate();
}
void BlimpContentBrowserClient::ExposeInterfacesToRenderer(
« no previous file with comments | « blimp/engine/app/blimp_content_browser_client.h ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698