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 CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ |
6 #define CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ | 6 #define CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "chrome/common/extensions/permissions/chrome_api_permissions.h" | 13 #include "chrome/common/extensions/permissions/chrome_api_permissions.h" |
12 #include "chrome/common/extensions/permissions/chrome_permission_message_provide
r.h" | 14 #include "chrome/common/extensions/permissions/chrome_permission_message_provide
r.h" |
13 #include "extensions/common/extensions_client.h" | 15 #include "extensions/common/extensions_client.h" |
14 #include "extensions/common/permissions/extensions_api_permissions.h" | 16 #include "extensions/common/permissions/extensions_api_permissions.h" |
15 | 17 |
16 namespace extensions { | 18 namespace extensions { |
17 | 19 |
18 // The implementation of ExtensionsClient for Chrome, which encapsulates the | 20 // The implementation of ExtensionsClient for Chrome, which encapsulates the |
19 // global knowledge of features, permissions, and manifest fields. | 21 // global knowledge of features, permissions, and manifest fields. |
20 class ChromeExtensionsClient : public ExtensionsClient { | 22 class ChromeExtensionsClient : public ExtensionsClient { |
21 public: | 23 public: |
22 ChromeExtensionsClient(); | 24 ChromeExtensionsClient(); |
23 ~ChromeExtensionsClient() override; | 25 ~ChromeExtensionsClient() override; |
24 | 26 |
25 void Initialize() override; | 27 void Initialize() override; |
26 | 28 |
27 const PermissionMessageProvider& GetPermissionMessageProvider() | 29 const PermissionMessageProvider& GetPermissionMessageProvider() |
28 const override; | 30 const override; |
29 const std::string GetProductName() override; | 31 const std::string GetProductName() override; |
30 scoped_ptr<FeatureProvider> CreateFeatureProvider( | 32 std::unique_ptr<FeatureProvider> CreateFeatureProvider( |
31 const std::string& name) const override; | 33 const std::string& name) const override; |
32 scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( | 34 std::unique_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( |
33 const std::string& name) const override; | 35 const std::string& name) const override; |
34 void FilterHostPermissions(const URLPatternSet& hosts, | 36 void FilterHostPermissions(const URLPatternSet& hosts, |
35 URLPatternSet* new_hosts, | 37 URLPatternSet* new_hosts, |
36 PermissionIDSet* permissions) const override; | 38 PermissionIDSet* permissions) const override; |
37 void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override; | 39 void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override; |
38 const ScriptingWhitelist& GetScriptingWhitelist() const override; | 40 const ScriptingWhitelist& GetScriptingWhitelist() const override; |
39 URLPatternSet GetPermittedChromeSchemeHosts( | 41 URLPatternSet GetPermittedChromeSchemeHosts( |
40 const Extension* extension, | 42 const Extension* extension, |
41 const APIPermissionSet& api_permissions) const override; | 43 const APIPermissionSet& api_permissions) const override; |
42 bool IsScriptableURL(const GURL& url, std::string* error) const override; | 44 bool IsScriptableURL(const GURL& url, std::string* error) const override; |
(...skipping 23 matching lines...) Expand all Loading... |
66 ScriptingWhitelist scripting_whitelist_; | 68 ScriptingWhitelist scripting_whitelist_; |
67 | 69 |
68 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsClient>; | 70 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsClient>; |
69 | 71 |
70 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsClient); | 72 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsClient); |
71 }; | 73 }; |
72 | 74 |
73 } // namespace extensions | 75 } // namespace extensions |
74 | 76 |
75 #endif // CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ | 77 #endif // CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ |
OLD | NEW |