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

Side by Side 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: simplified shell_content_browser_client.cc 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 unified diff | Download patch
« no previous file with comments | « content/public/browser/geolocation_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/browser/shell_content_browser_client.h" 5 #include "content/shell/browser/shell_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return crash_handler->GetDeathSignalSocket(); 115 return crash_handler->GetDeathSignalSocket();
116 } 116 }
117 117
118 return -1; 118 return -1;
119 } 119 }
120 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 120 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
121 121
122 // A provider of services for Geolocation. 122 // A provider of services for Geolocation.
123 class ShellGeolocationDelegate : public content::GeolocationDelegate { 123 class ShellGeolocationDelegate : public content::GeolocationDelegate {
124 public: 124 public:
125 explicit ShellGeolocationDelegate(ShellBrowserContext* context) 125 ShellGeolocationDelegate() {}
126 : context_(context) {}
127 126
128 scoped_refptr<AccessTokenStore> CreateAccessTokenStore() final { 127 scoped_refptr<AccessTokenStore> CreateAccessTokenStore() final {
129 return new ShellAccessTokenStore(context_); 128 return new ShellAccessTokenStore(
129 ShellContentBrowserClient::Get()->browser_context());
130 } 130 }
131 131
132 private: 132 private:
133 ShellBrowserContext* context_;
134
135 DISALLOW_COPY_AND_ASSIGN(ShellGeolocationDelegate); 133 DISALLOW_COPY_AND_ASSIGN(ShellGeolocationDelegate);
136 }; 134 };
137 135
138 } // namespace 136 } // namespace
139 137
140 ShellContentBrowserClient* ShellContentBrowserClient::Get() { 138 ShellContentBrowserClient* ShellContentBrowserClient::Get() {
141 return g_browser_client; 139 return g_browser_client;
142 } 140 }
143 141
144 void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) { 142 void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 ShellBrowserContext* ShellContentBrowserClient::browser_context() { 362 ShellBrowserContext* ShellContentBrowserClient::browser_context() {
365 return shell_browser_main_parts_->browser_context(); 363 return shell_browser_main_parts_->browser_context();
366 } 364 }
367 365
368 ShellBrowserContext* 366 ShellBrowserContext*
369 ShellContentBrowserClient::off_the_record_browser_context() { 367 ShellContentBrowserClient::off_the_record_browser_context() {
370 return shell_browser_main_parts_->off_the_record_browser_context(); 368 return shell_browser_main_parts_->off_the_record_browser_context();
371 } 369 }
372 370
373 GeolocationDelegate* ShellContentBrowserClient::CreateGeolocationDelegate() { 371 GeolocationDelegate* ShellContentBrowserClient::CreateGeolocationDelegate() {
374 return new ShellGeolocationDelegate(browser_context()); 372 return new ShellGeolocationDelegate();
375 } 373 }
376 374
377 } // namespace content 375 } // namespace content
OLDNEW
« 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