| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "chrome/common/extensions/permissions/chrome_api_permissions.h" | 11 #include "chrome/common/extensions/permissions/chrome_api_permissions.h" |
| 12 #include "extensions/common/extensions_client.h" | 12 #include "extensions/common/extensions_client.h" |
| 13 #include "extensions/common/permissions/permissions_provider.h" | 13 #include "extensions/common/permissions/permissions_provider.h" |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 // The implementation of ExtensionsClient for Chrome, which encapsulates the | 17 // The implementation of ExtensionsClient for Chrome, which encapsulates the |
| 18 // global knowledge of features, permissions, and manifest fields. | 18 // global knowledge of features, permissions, and manifest fields. |
| 19 class ChromeExtensionsClient : public ExtensionsClient { | 19 class ChromeExtensionsClient : public ExtensionsClient { |
| 20 public: | 20 public: |
| 21 ChromeExtensionsClient(); | 21 ChromeExtensionsClient(); |
| 22 virtual ~ChromeExtensionsClient(); | 22 virtual ~ChromeExtensionsClient(); |
| 23 | 23 |
| 24 virtual void Initialize() OVERRIDE; |
| 25 |
| 24 virtual const PermissionsProvider& GetPermissionsProvider() const OVERRIDE; | 26 virtual const PermissionsProvider& GetPermissionsProvider() const OVERRIDE; |
| 25 virtual void RegisterManifestHandlers() const OVERRIDE; | |
| 26 virtual FeatureProvider* GetFeatureProviderByName(const std::string& name) | 27 virtual FeatureProvider* GetFeatureProviderByName(const std::string& name) |
| 27 const OVERRIDE; | 28 const OVERRIDE; |
| 28 virtual void FilterHostPermissions( | 29 virtual void FilterHostPermissions( |
| 29 const URLPatternSet& hosts, | 30 const URLPatternSet& hosts, |
| 30 URLPatternSet* new_hosts, | 31 URLPatternSet* new_hosts, |
| 31 std::set<PermissionMessage>* messages) const OVERRIDE; | 32 std::set<PermissionMessage>* messages) const OVERRIDE; |
| 32 | 33 |
| 33 // Get the LazyInstance for ChromeExtensionsClient. | 34 // Get the LazyInstance for ChromeExtensionsClient. |
| 34 static ChromeExtensionsClient* GetInstance(); | 35 static ChromeExtensionsClient* GetInstance(); |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 const ChromeAPIPermissions chrome_api_permissions_; | 38 const ChromeAPIPermissions chrome_api_permissions_; |
| 38 | 39 |
| 39 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsClient>; | 40 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsClient>; |
| 40 | 41 |
| 41 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsClient); | 42 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsClient); |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 } // namespace extensions | 45 } // namespace extensions |
| 45 | 46 |
| 46 #endif // CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ | 47 #endif // CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ |
| OLD | NEW |