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

Unified Diff: chrome/browser/chrome_browser_main.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 | « blimp/engine/app/blimp_content_browser_client.cc ('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: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 0e43db3d18bfc0a510efad5e3f0f04a002d75c32..1166a7f31c04fbf2c8ea7305a92023145c11118f 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -59,6 +59,7 @@
#include "chrome/browser/component_updater/widevine_cdm_component_installer.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/first_run/first_run.h"
+#include "chrome/browser/geolocation/chrome_access_token_store.h"
#include "chrome/browser/gpu/gl_string_manager.h"
#include "chrome/browser/gpu/three_d_api_observer.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
@@ -140,6 +141,8 @@
#include "components/variations/variations_switches.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/geolocation_delegate.h"
+#include "content/public/browser/geolocation_provider.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
@@ -270,6 +273,19 @@ using content::BrowserThread;
namespace {
+// A provider of Geolocation services to override AccessTokenStore.
+class ChromeGeolocationDelegate : public content::GeolocationDelegate {
+ public:
+ ChromeGeolocationDelegate() = default;
+
+ scoped_refptr<content::AccessTokenStore> CreateAccessTokenStore() final {
+ return new ChromeAccessTokenStore();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationDelegate);
+};
+
// This function provides some ways to test crash and assertion handling
// behavior of the program.
void HandleTestParameters(const base::CommandLine& command_line) {
@@ -1201,6 +1217,9 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
// ChromeOS needs ResourceBundle::InitSharedInstance to be called before this.
browser_process_->PreCreateThreads();
+ content::GeolocationProvider::SetGeolocationDelegate(
+ new ChromeGeolocationDelegate());
+
return content::RESULT_CODE_NORMAL_EXIT;
}
« no previous file with comments | « blimp/engine/app/blimp_content_browser_client.cc ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698