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

Unified Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 2174613002: Geolocation: move creation of the GeolocationDelegate to the embedders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « chrome/browser/chrome_content_browser_client.cc ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/cast_browser_main_parts.cc
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc
index 91454778949ab50dce0f3b818a5af7e2fab9ce6e..216fc2c4e80a7e926d15de3f2b2b4e5edafeee98 100644
--- a/chromecast/browser/cast_browser_main_parts.cc
+++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -32,6 +32,7 @@
#include "chromecast/browser/cast_memory_pressure_monitor.h"
#include "chromecast/browser/cast_net_log.h"
#include "chromecast/browser/devtools/remote_debugging_server.h"
+#include "chromecast/browser/geolocation/cast_access_token_store.h"
#include "chromecast/browser/metrics/cast_metrics_prefs.h"
#include "chromecast/browser/metrics/cast_metrics_service_client.h"
#include "chromecast/browser/pref_service_helper.h"
@@ -49,6 +50,8 @@
#include "components/prefs/pref_registry_simple.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/geolocation_delegate.h"
+#include "content/public/browser/geolocation_provider.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_switches.h"
@@ -184,6 +187,22 @@ namespace shell {
namespace {
+// A provider of services for Geolocation.
+class CastGeolocationDelegate : public content::GeolocationDelegate {
+ public:
+ explicit CastGeolocationDelegate(CastBrowserContext* context)
+ : context_(context) {}
+
+ scoped_refptr<content::AccessTokenStore> CreateAccessTokenStore() override {
+ return new CastAccessTokenStore(context_);
+ }
+
+ private:
+ CastBrowserContext* context_;
+
+ DISALLOW_COPY_AND_ASSIGN(CastGeolocationDelegate);
+};
+
struct DefaultCommandLineSwitch {
const char* const switch_name;
const char* const switch_value;
@@ -451,6 +470,9 @@ void CastBrowserMainParts::PreMainMessageLoopRun() {
#endif
::media::InitializeMediaLibrary();
+ content::GeolocationProvider::SetGeolocationDelegate(
+ new CastGeolocationDelegate(cast_browser_process_->browser_context()));
+
// Initializing metrics service and network delegates must happen after cast
// service is intialized because CastMetricsServiceClient and
// CastNetworkDelegate may use components initialized by cast service.
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698