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 #include "extensions/shell/common/shell_extensions_client.h" | 5 #include "extensions/shell/common/shell_extensions_client.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "extensions/common/api/generated_schemas.h" | 9 #include "extensions/common/api/generated_schemas.h" |
10 #include "extensions/common/api/sockets/sockets_manifest_handler.h" | 10 #include "extensions/common/api/sockets/sockets_manifest_handler.h" |
11 #include "extensions/common/common_manifest_handlers.h" | 11 #include "extensions/common/common_manifest_handlers.h" |
12 #include "extensions/common/features/api_feature.h" | 12 #include "extensions/common/features/api_feature.h" |
13 #include "extensions/common/features/base_feature_provider.h" | 13 #include "extensions/common/features/base_feature_provider.h" |
14 #include "extensions/common/features/json_feature_provider_source.h" | 14 #include "extensions/common/features/json_feature_provider_source.h" |
15 #include "extensions/common/features/manifest_feature.h" | 15 #include "extensions/common/features/manifest_feature.h" |
16 #include "extensions/common/features/permission_feature.h" | 16 #include "extensions/common/features/permission_feature.h" |
17 #include "extensions/common/features/simple_feature.h" | 17 #include "extensions/common/features/simple_feature.h" |
18 #include "extensions/common/manifest_handler.h" | 18 #include "extensions/common/manifest_handler.h" |
19 #include "extensions/common/permissions/permission_message_provider.h" | 19 #include "extensions/common/permissions/permission_message_provider.h" |
20 #include "extensions/common/permissions/permissions_info.h" | 20 #include "extensions/common/permissions/permissions_info.h" |
21 #include "extensions/common/permissions/permissions_provider.h" | 21 #include "extensions/common/permissions/permissions_provider.h" |
22 #include "extensions/common/url_pattern_set.h" | 22 #include "extensions/common/url_pattern_set.h" |
23 #include "grit/extensions_resources.h" | 23 #include "grit/extensions_resources.h" |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
| 29 const char kWebstoreBaseURL[] = "https://chrome.google.com/webstore"; |
| 30 const char kWebstoreUpdateURL[] = |
| 31 "https://clients2.google.com/service/update2/crx"; |
| 32 |
29 template <class FeatureClass> | 33 template <class FeatureClass> |
30 SimpleFeature* CreateFeature() { | 34 SimpleFeature* CreateFeature() { |
31 return new FeatureClass; | 35 return new FeatureClass; |
32 } | 36 } |
33 | 37 |
34 // TODO(jamescook): Refactor ChromePermissionsMessageProvider so we can share | 38 // TODO(jamescook): Refactor ChromePermissionsMessageProvider so we can share |
35 // code. For now, this implementation does nothing. | 39 // code. For now, this implementation does nothing. |
36 class ShellPermissionMessageProvider : public PermissionMessageProvider { | 40 class ShellPermissionMessageProvider : public PermissionMessageProvider { |
37 public: | 41 public: |
38 ShellPermissionMessageProvider() {} | 42 ShellPermissionMessageProvider() {} |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 190 } |
187 | 191 |
188 void ShellExtensionsClient::RegisterAPISchemaResources( | 192 void ShellExtensionsClient::RegisterAPISchemaResources( |
189 ExtensionAPI* api) const { | 193 ExtensionAPI* api) const { |
190 } | 194 } |
191 | 195 |
192 bool ShellExtensionsClient::ShouldSuppressFatalErrors() const { | 196 bool ShellExtensionsClient::ShouldSuppressFatalErrors() const { |
193 return true; | 197 return true; |
194 } | 198 } |
195 | 199 |
| 200 std::string ShellExtensionsClient::GetWebstoreBaseURL() const { |
| 201 return kWebstoreBaseURL; |
| 202 } |
| 203 |
| 204 std::string ShellExtensionsClient::GetWebstoreUpdateURL() const { |
| 205 return kWebstoreUpdateURL; |
| 206 } |
| 207 |
| 208 bool ShellExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const { |
| 209 // TODO(rockot): Maybe we want to do something else here. For now we accept |
| 210 // any URL as a blacklist URL because we don't really care. |
| 211 return true; |
| 212 } |
| 213 |
196 } // namespace extensions | 214 } // namespace extensions |
OLD | NEW |