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

Unified Diff: content/shell/browser/shell_content_browser_client.cc

Issue 2127973002: Geolocation: change GeolocationDelegate to injected by content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rockot@ comments and sorting out ShellGeolocationDelegate. Rebased. 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 | « content/public/browser/geolocation_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell_content_browser_client.cc
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
index 13210702545de8838a543faf6605534b0a50fa2b..3fff9c22d1b2988fa3148968a78e11185262cfc3 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -122,15 +122,16 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
// A provider of services for Geolocation.
class ShellGeolocationDelegate : public content::GeolocationDelegate {
public:
- explicit ShellGeolocationDelegate(ShellBrowserContext* context)
- : context_(context) {}
+ using GetShellBrowserContextCB = base::Callback<ShellBrowserContext*(void)>;
+ explicit ShellGeolocationDelegate(GetShellBrowserContextCB get_context_cb)
+ : get_context_cb_(get_context_cb) {}
scoped_refptr<AccessTokenStore> CreateAccessTokenStore() final {
- return new ShellAccessTokenStore(context_);
+ return new ShellAccessTokenStore(get_context_cb_.Run());
}
private:
- ShellBrowserContext* context_;
+ GetShellBrowserContextCB get_context_cb_;
DISALLOW_COPY_AND_ASSIGN(ShellGeolocationDelegate);
};
@@ -371,7 +372,8 @@ ShellBrowserContext*
}
GeolocationDelegate* ShellContentBrowserClient::CreateGeolocationDelegate() {
- return new ShellGeolocationDelegate(browser_context());
+ return new ShellGeolocationDelegate(base::Bind(
+ &ShellContentBrowserClient::browser_context, base::Unretained(this)));
Ken Rockot(use gerrit already) 2016/07/20 20:47:04 This is pretty weird. Why not just get rid of the
mcasas 2016/07/20 20:53:14 Indeed why not! Done.
}
} // namespace content
« no previous file with comments | « content/public/browser/geolocation_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698