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

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: Rebase. Minor touch in LocationArbitratorImplTest to restate previous behaviour. 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 3c6ab5b12f0cbca56624ccd03df1c0253b746df6..531affe826996d3516e4e38fe76e28d726869b38 100644
--- a/blimp/engine/app/blimp_content_browser_client.cc
+++ b/blimp/engine/app/blimp_content_browser_client.cc
@@ -5,12 +5,31 @@
#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 {
Michael van Ouwerkerk 2016/06/28 11:17:07 nit: DISALLOW_COPY_AND_ASSIGN
mcasas 2016/06/28 16:51:25 Done.
+ public:
+ 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_;
+};
+
+} // anonymous namespace
+
BlimpContentBrowserClient::BlimpContentBrowserClient() {}
BlimpContentBrowserClient::~BlimpContentBrowserClient() {}
@@ -39,16 +58,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(

Powered by Google App Engine
This is Rietveld 408576698