Index: chrome/browser/plugins/flash_temporary_permission_tracker_factory.cc |
diff --git a/chrome/browser/plugins/flash_temporary_permission_tracker_factory.cc b/chrome/browser/plugins/flash_temporary_permission_tracker_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b17d5e335e48b0086615351d973ffd44c01513ea |
--- /dev/null |
+++ b/chrome/browser/plugins/flash_temporary_permission_tracker_factory.cc |
@@ -0,0 +1,43 @@ |
+// Copyright 2016 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/plugins/flash_temporary_permission_tracker_factory.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 |
+scoped_refptr<FlashTemporaryPermissionTracker> |
+FlashTemporaryPermissionTrackerFactory::GetForProfile(Profile* profile) { |
+ return static_cast<FlashTemporaryPermissionTracker*>( |
+ GetInstance()->GetServiceForBrowserContext(profile, true).get()); |
+} |
+ |
+// static |
+FlashTemporaryPermissionTrackerFactory* |
+FlashTemporaryPermissionTrackerFactory::GetInstance() { |
+ return base::Singleton<FlashTemporaryPermissionTrackerFactory>::get(); |
+} |
+ |
+FlashTemporaryPermissionTrackerFactory::FlashTemporaryPermissionTrackerFactory() |
+ : RefcountedBrowserContextKeyedServiceFactory( |
+ "FlashTemporaryPermissionTrackerFactory", |
+ BrowserContextDependencyManager::GetInstance()) {} |
+ |
+FlashTemporaryPermissionTrackerFactory:: |
+ ~FlashTemporaryPermissionTrackerFactory() {} |
+ |
+scoped_refptr<RefcountedKeyedService> |
+FlashTemporaryPermissionTrackerFactory::BuildServiceInstanceFor( |
+ content::BrowserContext* context) const { |
+ return new FlashTemporaryPermissionTracker( |
+ Profile::FromBrowserContext(context)); |
+} |
+ |
+content::BrowserContext* |
+FlashTemporaryPermissionTrackerFactory::GetBrowserContextToUse( |
+ content::BrowserContext* context) const { |
+ return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
+} |