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

Unified Diff: content/shell/browser/shell_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
Index: content/shell/browser/shell_browser_main_parts.cc
diff --git a/content/shell/browser/shell_browser_main_parts.cc b/content/shell/browser/shell_browser_main_parts.cc
index 7caf25c624b45481b2e4da88b07411ee36db1c3a..6e541e254200c385614ebfaeb0c9ebc7d19f114d 100644
--- a/content/shell/browser/shell_browser_main_parts.cc
+++ b/content/shell/browser/shell_browser_main_parts.cc
@@ -15,11 +15,14 @@
#include "build/build_config.h"
#include "components/devtools_http_handler/devtools_http_handler.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/storage_partition.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/url_constants.h"
#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_access_token_store.h"
#include "content/shell/browser/shell_browser_context.h"
#include "content/shell/browser/shell_devtools_manager_delegate.h"
#include "content/shell/browser/shell_net_log.h"
@@ -55,6 +58,21 @@ namespace content {
namespace {
+// A provider of services for Geolocation.
+class ShellGeolocationDelegate : public content::GeolocationDelegate {
+ public:
+ explicit ShellGeolocationDelegate(ShellBrowserContext* context)
+ : context_(context) {}
+
+ scoped_refptr<content::AccessTokenStore> CreateAccessTokenStore() final {
+ return new ShellAccessTokenStore(context_);
+ }
+
+ private:
+ ShellBrowserContext* context_;
+ DISALLOW_COPY_AND_ASSIGN(ShellGeolocationDelegate);
+};
+
GURL GetStartupURL() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kContentBrowserTest))
@@ -165,6 +183,8 @@ int ShellBrowserMainParts::PreCreateThreads() {
void ShellBrowserMainParts::PreMainMessageLoopRun() {
net_log_.reset(new ShellNetLog("content_shell"));
InitializeBrowserContexts();
+ content::GeolocationProvider::SetGeolocationDelegate(
+ new ShellGeolocationDelegate(browser_context()));
Shell::Initialize();
net::NetModule::SetResourceProvider(PlatformResourceProvider);
« no previous file with comments | « content/public/browser/content_browser_client.cc ('k') | content/shell/browser/shell_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698