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

Side by Side Diff: chrome/browser/plugins/flash_temporary_permission_tracker_factory.cc

Issue 2413683005: [HBD] If DefaultPluginPolicy set to 3, prompt should allow flash for the next page load only (Closed)
Patch Set: [HBD] If DefaultPluginPolicy set to 3, prompt should allow flash for the next page load only Created 4 years, 2 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 2016 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/plugins/flash_temporary_permission_tracker_factory.h"
6
7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10
11 // static
12 scoped_refptr<FlashTemporaryPermissionTracker>
13 FlashTemporaryPermissionTrackerFactory::GetForProfile(Profile* profile) {
14 return static_cast<FlashTemporaryPermissionTracker*>(
15 GetInstance()->GetServiceForBrowserContext(profile, true).get());
16 }
17
18 // static
19 FlashTemporaryPermissionTrackerFactory*
20 FlashTemporaryPermissionTrackerFactory::GetInstance() {
21 return base::Singleton<FlashTemporaryPermissionTrackerFactory>::get();
22 }
23
24 FlashTemporaryPermissionTrackerFactory::FlashTemporaryPermissionTrackerFactory()
25 : RefcountedBrowserContextKeyedServiceFactory(
26 "FlashTemporaryPermissionTrackerFactory",
27 BrowserContextDependencyManager::GetInstance()) {}
28
29 FlashTemporaryPermissionTrackerFactory::
30 ~FlashTemporaryPermissionTrackerFactory() {}
31
32 scoped_refptr<RefcountedKeyedService>
33 FlashTemporaryPermissionTrackerFactory::BuildServiceInstanceFor(
34 content::BrowserContext* context) const {
35 return new FlashTemporaryPermissionTracker(
36 Profile::FromBrowserContext(context));
37 }
38
39 content::BrowserContext*
40 FlashTemporaryPermissionTrackerFactory::GetBrowserContextToUse(
41 content::BrowserContext* context) const {
42 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698