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

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

Issue 1871343002: Remove PermissionContext factories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h"
6
7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/common/features.h"
10 #include "chrome/common/pref_names.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 #include "components/pref_registry/pref_registry_syncable.h"
13 #if BUILDFLAG(ANDROID_JAVA_UI)
14 #include "chrome/browser/geolocation/geolocation_permission_context_android.h"
15 #else
16 #include "chrome/browser/geolocation/geolocation_permission_context.h"
17 #endif
18
19
20 // static
21 GeolocationPermissionContext*
22 GeolocationPermissionContextFactory::GetForProfile(Profile* profile) {
23 return static_cast<GeolocationPermissionContext*>(
24 GetInstance()->GetServiceForBrowserContext(profile, true));
25 }
26
27 // static
28 GeolocationPermissionContextFactory*
29 GeolocationPermissionContextFactory::GetInstance() {
30 return base::Singleton<GeolocationPermissionContextFactory>::get();
31 }
32
33 #if !BUILDFLAG(ANDROID_JAVA_UI)
34 GeolocationPermissionContextFactory::GeolocationPermissionContextFactory()
35 : PermissionContextFactoryBase(
36 "GeolocationPermissionContext",
37 BrowserContextDependencyManager::GetInstance()) {
38 }
39 #else
40 GeolocationPermissionContextFactory::GeolocationPermissionContextFactory()
41 : PermissionContextFactoryBase(
42 "GeolocationPermissionContextAndroid",
43 BrowserContextDependencyManager::GetInstance()) {
44 }
45 #endif
46
47
48 GeolocationPermissionContextFactory::~GeolocationPermissionContextFactory() {
49 }
50
51 KeyedService*
52 GeolocationPermissionContextFactory::BuildServiceInstanceFor(
53 content::BrowserContext* profile) const {
54 #if !BUILDFLAG(ANDROID_JAVA_UI)
55 return new GeolocationPermissionContext(static_cast<Profile*>(profile));
56 #else
57 return new GeolocationPermissionContextAndroid(
58 static_cast<Profile*>(profile));
59 #endif
60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698