OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_EXTENSIONS_CLIENT_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ |
6 #define EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ | 6 #define EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 10 matching lines...) Expand all Loading... |
21 class PermissionMessageProvider; | 21 class PermissionMessageProvider; |
22 class PermissionsProvider; | 22 class PermissionsProvider; |
23 class URLPatternSet; | 23 class URLPatternSet; |
24 | 24 |
25 // Sets up global state for the extensions system. Should be Set() once in each | 25 // Sets up global state for the extensions system. Should be Set() once in each |
26 // process. This should be implemented by the client of the extensions system. | 26 // process. This should be implemented by the client of the extensions system. |
27 class ExtensionsClient { | 27 class ExtensionsClient { |
28 public: | 28 public: |
29 typedef std::vector<std::string> ScriptingWhitelist; | 29 typedef std::vector<std::string> ScriptingWhitelist; |
30 | 30 |
| 31 virtual ~ExtensionsClient() {} |
| 32 |
31 // Initializes global state. Not done in the constructor because unit tests | 33 // Initializes global state. Not done in the constructor because unit tests |
32 // can create additional ExtensionsClients because the utility thread runs | 34 // can create additional ExtensionsClients because the utility thread runs |
33 // in-process. | 35 // in-process. |
34 virtual void Initialize() = 0; | 36 virtual void Initialize() = 0; |
35 | 37 |
36 // Returns a PermissionsProvider to initialize the permissions system. | 38 // Returns a PermissionsProvider to initialize the permissions system. |
37 virtual const PermissionsProvider& GetPermissionsProvider() const = 0; | 39 virtual const PermissionsProvider& GetPermissionsProvider() const = 0; |
38 | 40 |
39 // Returns the global PermissionMessageProvider to use to provide permission | 41 // Returns the global PermissionMessageProvider to use to provide permission |
40 // warning strings. | 42 // warning strings. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Return the extensions client. | 74 // Return the extensions client. |
73 static ExtensionsClient* Get(); | 75 static ExtensionsClient* Get(); |
74 | 76 |
75 // Initialize the extensions system with this extensions client. | 77 // Initialize the extensions system with this extensions client. |
76 static void Set(ExtensionsClient* client); | 78 static void Set(ExtensionsClient* client); |
77 }; | 79 }; |
78 | 80 |
79 } // namespace extensions | 81 } // namespace extensions |
80 | 82 |
81 #endif // EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ | 83 #endif // EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ |
OLD | NEW |