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

Unified Diff: content/browser/geolocation/geolocation_provider_impl.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: content/browser/geolocation/geolocation_provider_impl.cc
diff --git a/content/browser/geolocation/geolocation_provider_impl.cc b/content/browser/geolocation/geolocation_provider_impl.cc
index f3d6e37e062bf002b3b4050ab5c6cdb5e17a19e0..4cf212f3c7906a972ba6ecc2784e639e8aed202d 100644
--- a/content/browser/geolocation/geolocation_provider_impl.cc
+++ b/content/browser/geolocation/geolocation_provider_impl.cc
@@ -14,6 +14,8 @@
#include "base/single_thread_task_runner.h"
#include "content/browser/geolocation/location_arbitrator_impl.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/browser_thread.h"
Michael van Ouwerkerk 2016/06/24 13:57:18 nit: delete this duplicated include
mcasas 2016/06/24 19:25:52 Done.
+#include "content/public/browser/content_browser_client.h"
namespace content {
@@ -174,7 +176,15 @@ std::unique_ptr<LocationArbitrator>
GeolocationProviderImpl::CreateArbitrator() {
LocationArbitratorImpl::LocationUpdateCallback callback = base::Bind(
&GeolocationProviderImpl::OnLocationUpdate, base::Unretained(this));
- return base::WrapUnique(new LocationArbitratorImpl(callback));
+
+ // Use the embedder for service overrides or fall back to the default ones.
+ GeolocationProvider::ServiceOverrides* service_overrides =
+ GetContentClient()->browser()->GetGeolocationServiceOverrides();
+ if (!service_overrides)
+ service_overrides = new GeolocationProvider::ServiceOverrides;
+
+ return base::WrapUnique(
+ new LocationArbitratorImpl(callback, service_overrides));
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698