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

Side by Side Diff: chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/geolocation/chrome_geolocation_permission_context_facto ry.h" 5 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto ry.h"
6 6
7 #include "chrome/browser/profiles/profile.h"
7 #include "chrome/browser/profiles/profile_dependency_manager.h" 8 #include "chrome/browser/profiles/profile_dependency_manager.h"
8 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
9 #include "components/user_prefs/pref_registry_syncable.h" 10 #include "components/user_prefs/pref_registry_syncable.h"
10 #if defined(OS_ANDROID) 11 #if defined(OS_ANDROID)
11 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_andro id.h" 12 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_andro id.h"
12 #else 13 #else
13 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" 14 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
14 #endif 15 #endif
15 16
16 namespace { 17 namespace {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 "ChromeGeolocationPermissionContext", 61 "ChromeGeolocationPermissionContext",
61 ProfileDependencyManager::GetInstance()) { 62 ProfileDependencyManager::GetInstance()) {
62 } 63 }
63 64
64 ChromeGeolocationPermissionContextFactory:: 65 ChromeGeolocationPermissionContextFactory::
65 ~ChromeGeolocationPermissionContextFactory() { 66 ~ChromeGeolocationPermissionContextFactory() {
66 } 67 }
67 68
68 ProfileKeyedService* 69 ProfileKeyedService*
69 ChromeGeolocationPermissionContextFactory::BuildServiceInstanceFor( 70 ChromeGeolocationPermissionContextFactory::BuildServiceInstanceFor(
70 Profile* profile) const { 71 content::BrowserContext* profile) const {
71 return new Service(profile); 72 return new Service(static_cast<Profile*>(profile));
72 } 73 }
73 74
74 void ChromeGeolocationPermissionContextFactory::RegisterUserPrefs( 75 void ChromeGeolocationPermissionContextFactory::RegisterUserPrefs(
75 PrefRegistrySyncable* registry) { 76 PrefRegistrySyncable* registry) {
76 #if defined(OS_ANDROID) 77 #if defined(OS_ANDROID)
77 registry->RegisterBooleanPref(prefs::kGeolocationEnabled, 78 registry->RegisterBooleanPref(prefs::kGeolocationEnabled,
78 true, 79 true,
79 PrefRegistrySyncable::UNSYNCABLE_PREF); 80 PrefRegistrySyncable::UNSYNCABLE_PREF);
80 #endif 81 #endif
81 } 82 }
82 83
83 bool ChromeGeolocationPermissionContextFactory:: 84 bool ChromeGeolocationPermissionContextFactory::
84 ServiceRedirectedInIncognito() const { 85 ServiceRedirectedInIncognito() const {
85 return false; 86 return false;
86 } 87 }
87 88
88 bool ChromeGeolocationPermissionContextFactory:: 89 bool ChromeGeolocationPermissionContextFactory::
89 ServiceHasOwnInstanceInIncognito() const { 90 ServiceHasOwnInstanceInIncognito() const {
90 return true; 91 return true;
91 } 92 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698