| OLD | NEW |
| 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/geolocation_permission_context_factory.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/incognito_helpers.h" | 7 #include "chrome/browser/profiles/incognito_helpers.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 // static | 26 // static |
| 27 GeolocationPermissionContextFactory* | 27 GeolocationPermissionContextFactory* |
| 28 GeolocationPermissionContextFactory::GetInstance() { | 28 GeolocationPermissionContextFactory::GetInstance() { |
| 29 return Singleton<GeolocationPermissionContextFactory>::get(); | 29 return Singleton<GeolocationPermissionContextFactory>::get(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 #if !defined(OS_ANDROID) | 32 #if !defined(OS_ANDROID) |
| 33 GeolocationPermissionContextFactory::GeolocationPermissionContextFactory() | 33 GeolocationPermissionContextFactory::GeolocationPermissionContextFactory() |
| 34 : BrowserContextKeyedServiceFactory( | 34 : PermissionContextFactoryBase( |
| 35 "GeolocationPermissionContext", | 35 "GeolocationPermissionContext", |
| 36 BrowserContextDependencyManager::GetInstance()) { | 36 BrowserContextDependencyManager::GetInstance()) { |
| 37 } | 37 } |
| 38 #else | 38 #else |
| 39 GeolocationPermissionContextFactory::GeolocationPermissionContextFactory() | 39 GeolocationPermissionContextFactory::GeolocationPermissionContextFactory() |
| 40 : BrowserContextKeyedServiceFactory( | 40 : PermissionContextFactoryBase( |
| 41 "GeolocationPermissionContextAndroid", | 41 "GeolocationPermissionContextAndroid", |
| 42 BrowserContextDependencyManager::GetInstance()) { | 42 BrowserContextDependencyManager::GetInstance()) { |
| 43 } | 43 } |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 | 46 |
| 47 GeolocationPermissionContextFactory::~GeolocationPermissionContextFactory() { | 47 GeolocationPermissionContextFactory::~GeolocationPermissionContextFactory() { |
| 48 } | 48 } |
| 49 | 49 |
| 50 KeyedService* | 50 KeyedService* |
| (...skipping 12 matching lines...) Expand all Loading... |
| 63 #if defined(OS_ANDROID) | 63 #if defined(OS_ANDROID) |
| 64 registry->RegisterBooleanPref(prefs::kGeolocationEnabled, true); | 64 registry->RegisterBooleanPref(prefs::kGeolocationEnabled, true); |
| 65 #endif | 65 #endif |
| 66 } | 66 } |
| 67 | 67 |
| 68 content::BrowserContext* | 68 content::BrowserContext* |
| 69 GeolocationPermissionContextFactory::GetBrowserContextToUse( | 69 GeolocationPermissionContextFactory::GetBrowserContextToUse( |
| 70 content::BrowserContext* context) const { | 70 content::BrowserContext* context) const { |
| 71 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 71 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
| 72 } | 72 } |
| OLD | NEW |