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

Side by Side Diff: chrome/browser/content_settings/permission_observer_factory.cc

Issue 990303002: Implement PermissionService::GetNextPermissionChange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission_impl
Patch Set: review comments Created 5 years, 9 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 2015 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/content_settings/permission_observer_factory.h"
6
7 #include "chrome/browser/content_settings/permission_context.h"
8 #include "chrome/browser/content_settings/permission_observer.h"
9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12
13 // static
14 PermissionObserver*
15 PermissionObserverFactory::GetForProfile(Profile* profile) {
16 return static_cast<PermissionObserver*>(
17 GetInstance()->GetServiceForBrowserContext(profile, true));
18 }
19
20 // static
21 PermissionObserverFactory* PermissionObserverFactory::GetInstance() {
22 return Singleton<PermissionObserverFactory>::get();
23 }
24
25 PermissionObserverFactory::PermissionObserverFactory()
26 : BrowserContextKeyedServiceFactory(
27 "PermissionObserverFactory",
28 BrowserContextDependencyManager::GetInstance()) {
29 for (KeyedServiceBaseFactory* factory : PermissionContext::GetFactories())
30 DependsOn(factory);
31 }
32
33 PermissionObserverFactory::~PermissionObserverFactory() {
34 }
35
36 KeyedService* PermissionObserverFactory::BuildServiceInstanceFor(
37 content::BrowserContext* context) const {
38 return new PermissionObserver(Profile::FromBrowserContext(context));
39 }
40
41 content::BrowserContext*
42 PermissionObserverFactory::GetBrowserContextToUse(
43 content::BrowserContext* context) const {
44 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698