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

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: Changing to ContentBrowserClient::GetGeolocationServiceOverrides and impl'd in the 6 impl's. Unitte… Created 4 years, 6 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
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 ShellGeolocationServiceOverrides
123 : public content::GeolocationProvider::ServiceOverrides {
124 public:
125 explicit ShellGeolocationServiceOverrides(ShellBrowserContext* context)
126 : context_(context) {}
127 AccessTokenStore* CreateAccessTokenStore() override {
128 return new ShellAccessTokenStore(context_);
129 }
130 private:
131 ShellBrowserContext* context_;
132 };
133
121 } // namespace 134 } // namespace
122 135
123 ShellContentBrowserClient* ShellContentBrowserClient::Get() { 136 ShellContentBrowserClient* ShellContentBrowserClient::Get() {
124 return g_browser_client; 137 return g_browser_client;
125 } 138 }
126 139
127 void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) { 140 void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) {
128 g_swap_processes_for_redirect = swap; 141 g_swap_processes_for_redirect = swap;
129 } 142 }
130 143
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 359
347 ShellBrowserContext* ShellContentBrowserClient::browser_context() { 360 ShellBrowserContext* ShellContentBrowserClient::browser_context() {
348 return shell_browser_main_parts_->browser_context(); 361 return shell_browser_main_parts_->browser_context();
349 } 362 }
350 363
351 ShellBrowserContext* 364 ShellBrowserContext*
352 ShellContentBrowserClient::off_the_record_browser_context() { 365 ShellContentBrowserClient::off_the_record_browser_context() {
353 return shell_browser_main_parts_->off_the_record_browser_context(); 366 return shell_browser_main_parts_->off_the_record_browser_context();
354 } 367 }
355 368
356 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { 369 GeolocationProvider::ServiceOverrides*
357 return new ShellAccessTokenStore(browser_context()); 370 ShellContentBrowserClient::GetGeolocationServiceOverrides() {
371 return new ShellGeolocationServiceOverrides(browser_context());
358 } 372 }
359 373
360 } // namespace content 374 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698