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

Side by Side Diff: content/shell/browser/shell_content_browser_client.cc

Issue 2098553002: Geolocation: extract ContentBrowserClient methods specific to Geolocation into a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a TODO 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/shell/browser/shell_content_browser_client.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; 111 static breakpad::CrashHandlerHostLinux* crash_handler = NULL;
112 if (!crash_handler) 112 if (!crash_handler)
113 crash_handler = CreateCrashHandlerHost(process_type); 113 crash_handler = CreateCrashHandlerHost(process_type);
114 return crash_handler->GetDeathSignalSocket(); 114 return crash_handler->GetDeathSignalSocket();
115 } 115 }
116 116
117 return -1; 117 return -1;
118 } 118 }
119 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 119 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
120 120
121 // A provider of services for Geolocation.
122 class ShellGeolocationDelegate : public content::GeolocationProvider::Delegate {
123 public:
124 explicit ShellGeolocationDelegate(ShellBrowserContext* context)
125 : context_(context) {}
126
127 AccessTokenStore* CreateAccessTokenStore() final {
128 return new ShellAccessTokenStore(context_);
129 }
130
131 private:
132 ShellBrowserContext* context_;
133
134 DISALLOW_COPY_AND_ASSIGN(ShellGeolocationDelegate);
135 };
136
121 } // namespace 137 } // namespace
122 138
123 ShellContentBrowserClient* ShellContentBrowserClient::Get() { 139 ShellContentBrowserClient* ShellContentBrowserClient::Get() {
124 return g_browser_client; 140 return g_browser_client;
125 } 141 }
126 142
127 void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) { 143 void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) {
128 g_swap_processes_for_redirect = swap; 144 g_swap_processes_for_redirect = swap;
129 } 145 }
130 146
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 362
347 ShellBrowserContext* ShellContentBrowserClient::browser_context() { 363 ShellBrowserContext* ShellContentBrowserClient::browser_context() {
348 return shell_browser_main_parts_->browser_context(); 364 return shell_browser_main_parts_->browser_context();
349 } 365 }
350 366
351 ShellBrowserContext* 367 ShellBrowserContext*
352 ShellContentBrowserClient::off_the_record_browser_context() { 368 ShellContentBrowserClient::off_the_record_browser_context() {
353 return shell_browser_main_parts_->off_the_record_browser_context(); 369 return shell_browser_main_parts_->off_the_record_browser_context();
354 } 370 }
355 371
356 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { 372 GeolocationProvider::Delegate*
357 return new ShellAccessTokenStore(browser_context()); 373 ShellContentBrowserClient::CreateGeolocationDelegate() {
374 return new ShellGeolocationDelegate(browser_context());
358 } 375 }
359 376
360 } // namespace content 377 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_content_browser_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698