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

Unified 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: cosmetic changes 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/content_settings/permission_observer_factory.cc
diff --git a/chrome/browser/content_settings/permission_observer_factory.cc b/chrome/browser/content_settings/permission_observer_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..940437a863d3823537e0b819820d8252c89ad8fd
--- /dev/null
+++ b/chrome/browser/content_settings/permission_observer_factory.cc
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/content_settings/permission_observer_factory.h"
+
+#include "chrome/browser/content_settings/permission_observer.h"
+#include "chrome/browser/profiles/incognito_helpers.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+// static
+PermissionObserver*
+PermissionObserverFactory::GetForProfile(Profile* profile) {
+ return static_cast<PermissionObserver*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+PermissionObserverFactory* PermissionObserverFactory::GetInstance() {
+ return Singleton<PermissionObserverFactory>::get();
+}
+
+PermissionObserverFactory::PermissionObserverFactory()
+ : BrowserContextKeyedServiceFactory(
+ "PermissionObserverFactory",
+ BrowserContextDependencyManager::GetInstance()) {
Bernhard Bauer 2015/03/11 14:06:18 You need to declare your dependencies on other key
mlamouri (slow - plz ping) 2015/03/18 16:24:40 I exposed a way to get the PermissionContext relat
+}
+
+PermissionObserverFactory::~PermissionObserverFactory() {
+}
+
+KeyedService* PermissionObserverFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new PermissionObserver(Profile::FromBrowserContext(context));
+}
+
+content::BrowserContext*
+PermissionObserverFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return chrome::GetBrowserContextOwnInstanceInIncognito(context);
+}

Powered by Google App Engine
This is Rietveld 408576698