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

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: 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
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..ccad74979c214007f69acd6f89515e5d5bc3014a 100644
--- a/content/browser/geolocation/geolocation_provider_impl.cc
+++ b/content/browser/geolocation/geolocation_provider_impl.cc
@@ -14,6 +14,7 @@
#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/content_browser_client.h"
namespace content {
@@ -174,7 +175,14 @@ 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's Delegate or fall back to the default one.
+ delegate_.reset(GetContentClient()->browser()->CreateGeolocationDelegate());
+ if (!delegate_)
+ delegate_.reset(new GeolocationProvider::Delegate);
+
+ return base::WrapUnique(
+ new LocationArbitratorImpl(callback, delegate_.get()));
}
} // namespace content
« no previous file with comments | « content/browser/geolocation/geolocation_provider_impl.h ('k') | content/browser/geolocation/location_arbitrator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698