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

Side by Side Diff: chrome/browser/usb/usb_chooser_permission_context_factory.cc

Issue 1382783002: Store USB device permissions in website settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove UsbPermissionContext and add ChooserPermissionContext helper functions. Created 5 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 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/usb/usb_chooser_permission_context_factory.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/usb/usb_chooser_permission_context.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10
11 UsbChooserPermissionContextFactory::UsbChooserPermissionContextFactory()
12 : PermissionContextFactoryBase(
13 "UsbChooserPermissionContext",
14 BrowserContextDependencyManager::GetInstance()) {}
15
16 UsbChooserPermissionContextFactory::~UsbChooserPermissionContextFactory() {}
17
18 KeyedService* UsbChooserPermissionContextFactory::BuildServiceInstanceFor(
19 content::BrowserContext* context) const {
20 return new UsbChooserPermissionContext(Profile::FromBrowserContext(context));
21 }
22
23 // static
24 UsbChooserPermissionContextFactory*
25 UsbChooserPermissionContextFactory::GetInstance() {
26 return base::Singleton<UsbChooserPermissionContextFactory>::get();
27 }
28
29 // static
30 UsbChooserPermissionContext* UsbChooserPermissionContextFactory::GetForProfile(
31 Profile* profile) {
32 return static_cast<UsbChooserPermissionContext*>(
33 GetInstance()->GetServiceForBrowserContext(profile, true));
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698