| 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 <memory> |
| 8 #include <set> | 9 #include <set> |
| 9 #include <string> | 10 #include <string> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 14 #include "extensions/common/permissions/api_permission_set.h" | 14 #include "extensions/common/permissions/api_permission_set.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class FilePath; | 19 class FilePath; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 47 | 47 |
| 48 // Returns the global PermissionMessageProvider to use to provide permission | 48 // Returns the global PermissionMessageProvider to use to provide permission |
| 49 // warning strings. | 49 // warning strings. |
| 50 virtual const PermissionMessageProvider& GetPermissionMessageProvider() | 50 virtual const PermissionMessageProvider& GetPermissionMessageProvider() |
| 51 const = 0; | 51 const = 0; |
| 52 | 52 |
| 53 // Returns the application name. For example, "Chromium" or "app_shell". | 53 // Returns the application name. For example, "Chromium" or "app_shell". |
| 54 virtual const std::string GetProductName() = 0; | 54 virtual const std::string GetProductName() = 0; |
| 55 | 55 |
| 56 // Create a FeatureProvider for a specific feature type, e.g. "permission". | 56 // Create a FeatureProvider for a specific feature type, e.g. "permission". |
| 57 virtual scoped_ptr<FeatureProvider> CreateFeatureProvider( | 57 virtual std::unique_ptr<FeatureProvider> CreateFeatureProvider( |
| 58 const std::string& name) const = 0; | 58 const std::string& name) const = 0; |
| 59 | 59 |
| 60 // Create a JSONFeatureProviderSource for a specific feature type, | 60 // Create a JSONFeatureProviderSource for a specific feature type, |
| 61 // e.g. "permission". Currently, all features are loaded from | 61 // e.g. "permission". Currently, all features are loaded from |
| 62 // JSONFeatureProviderSources. | 62 // JSONFeatureProviderSources. |
| 63 // This is used primarily in CreateFeatureProvider, above. | 63 // This is used primarily in CreateFeatureProvider, above. |
| 64 virtual scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( | 64 virtual std::unique_ptr<JSONFeatureProviderSource> |
| 65 const std::string& name) const = 0; | 65 CreateFeatureProviderSource(const std::string& name) const = 0; |
| 66 | 66 |
| 67 // Takes the list of all hosts and filters out those with special | 67 // Takes the list of all hosts and filters out those with special |
| 68 // permission strings. Adds the regular hosts to |new_hosts|, | 68 // permission strings. Adds the regular hosts to |new_hosts|, |
| 69 // and adds any additional permissions to |permissions|. | 69 // and adds any additional permissions to |permissions|. |
| 70 // TODO(sashab): Split this function in two: One to filter out ignored host | 70 // TODO(sashab): Split this function in two: One to filter out ignored host |
| 71 // permissions, and one to get permissions for the given hosts. | 71 // permissions, and one to get permissions for the given hosts. |
| 72 virtual void FilterHostPermissions(const URLPatternSet& hosts, | 72 virtual void FilterHostPermissions(const URLPatternSet& hosts, |
| 73 URLPatternSet* new_hosts, | 73 URLPatternSet* new_hosts, |
| 74 PermissionIDSet* permissions) const = 0; | 74 PermissionIDSet* permissions) const = 0; |
| 75 | 75 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // Return the extensions client. | 134 // Return the extensions client. |
| 135 static ExtensionsClient* Get(); | 135 static ExtensionsClient* Get(); |
| 136 | 136 |
| 137 // Initialize the extensions system with this extensions client. | 137 // Initialize the extensions system with this extensions client. |
| 138 static void Set(ExtensionsClient* client); | 138 static void Set(ExtensionsClient* client); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace extensions | 141 } // namespace extensions |
| 142 | 142 |
| 143 #endif // EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ | 143 #endif // EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_ |
| OLD | NEW |