| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_DEVICE_PERMISSION_MANAGER_H_ | 5 #ifndef EXTENSIONS_DEVICE_PERMISSION_MANAGER_H_ |
| 6 #define EXTENSIONS_DEVICE_PERMISSION_MANAGER_H_ | 6 #define EXTENSIONS_DEVICE_PERMISSION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/scoped_observer.h" | 16 #include "base/scoped_observer.h" |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
| 19 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 19 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 20 #include "components/keyed_service/core/keyed_service.h" | 20 #include "components/keyed_service/core/keyed_service.h" |
| 21 #include "device/hid/hid_service.h" | 21 #include "device/hid/hid_service.h" |
| 22 #include "device/usb/usb_service.h" | 22 #include "device/usb/usb_service.h" |
| 23 | 23 |
| 24 namespace base { |
| 24 template <typename T> | 25 template <typename T> |
| 25 struct DefaultSingletonTraits; | 26 struct DefaultSingletonTraits; |
| 26 | |
| 27 namespace base { | |
| 28 class Value; | 27 class Value; |
| 29 } | 28 } |
| 30 | 29 |
| 31 namespace content { | 30 namespace content { |
| 32 class BrowserContext; | 31 class BrowserContext; |
| 33 } | 32 } |
| 34 | 33 |
| 35 namespace extensions { | 34 namespace extensions { |
| 36 | 35 |
| 37 // Stores information about a device saved with access granted. | 36 // Stores information about a device saved with access granted. |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 }; | 202 }; |
| 204 | 203 |
| 205 class DevicePermissionsManagerFactory | 204 class DevicePermissionsManagerFactory |
| 206 : public BrowserContextKeyedServiceFactory { | 205 : public BrowserContextKeyedServiceFactory { |
| 207 public: | 206 public: |
| 208 static DevicePermissionsManager* GetForBrowserContext( | 207 static DevicePermissionsManager* GetForBrowserContext( |
| 209 content::BrowserContext* context); | 208 content::BrowserContext* context); |
| 210 static DevicePermissionsManagerFactory* GetInstance(); | 209 static DevicePermissionsManagerFactory* GetInstance(); |
| 211 | 210 |
| 212 private: | 211 private: |
| 213 friend struct DefaultSingletonTraits<DevicePermissionsManagerFactory>; | 212 friend struct base::DefaultSingletonTraits<DevicePermissionsManagerFactory>; |
| 214 | 213 |
| 215 DevicePermissionsManagerFactory(); | 214 DevicePermissionsManagerFactory(); |
| 216 ~DevicePermissionsManagerFactory() override; | 215 ~DevicePermissionsManagerFactory() override; |
| 217 | 216 |
| 218 // BrowserContextKeyedServiceFactory implementation | 217 // BrowserContextKeyedServiceFactory implementation |
| 219 KeyedService* BuildServiceInstanceFor( | 218 KeyedService* BuildServiceInstanceFor( |
| 220 content::BrowserContext* context) const override; | 219 content::BrowserContext* context) const override; |
| 221 content::BrowserContext* GetBrowserContextToUse( | 220 content::BrowserContext* GetBrowserContextToUse( |
| 222 content::BrowserContext* context) const override; | 221 content::BrowserContext* context) const override; |
| 223 | 222 |
| 224 DISALLOW_COPY_AND_ASSIGN(DevicePermissionsManagerFactory); | 223 DISALLOW_COPY_AND_ASSIGN(DevicePermissionsManagerFactory); |
| 225 }; | 224 }; |
| 226 | 225 |
| 227 } // namespace extensions | 226 } // namespace extensions |
| 228 | 227 |
| 229 #endif // EXTENSIONS_DEVICE_PERMISSION_MANAGER_H_ | 228 #endif // EXTENSIONS_DEVICE_PERMISSION_MANAGER_H_ |
| OLD | NEW |