| 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 "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "extensions/common/api/generated_schemas.h" | 10 #include "extensions/common/api/generated_schemas.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 DISALLOW_COPY_AND_ASSIGN(ShellPermissionMessageProvider); | 70 DISALLOW_COPY_AND_ASSIGN(ShellPermissionMessageProvider); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 base::LazyInstance<ShellPermissionMessageProvider> | 73 base::LazyInstance<ShellPermissionMessageProvider> |
| 74 g_permission_message_provider = LAZY_INSTANCE_INITIALIZER; | 74 g_permission_message_provider = LAZY_INSTANCE_INITIALIZER; |
| 75 | 75 |
| 76 } // namespace | 76 } // namespace |
| 77 | 77 |
| 78 ShellExtensionsClient::ShellExtensionsClient() | 78 ShellExtensionsClient::ShellExtensionsClient() |
| 79 : extensions_api_permissions_(ExtensionsAPIPermissions()), | 79 : extensions_api_permissions_(ExtensionsAPIPermissions()), |
| 80 webstore_base_url_(extension_urls::kChromeWebstoreBaseURL), |
| 80 webstore_update_url_(extension_urls::kChromeWebstoreUpdateURL) {} | 81 webstore_update_url_(extension_urls::kChromeWebstoreUpdateURL) {} |
| 81 | 82 |
| 82 ShellExtensionsClient::~ShellExtensionsClient() { | 83 ShellExtensionsClient::~ShellExtensionsClient() { |
| 83 } | 84 } |
| 84 | 85 |
| 85 void ShellExtensionsClient::Initialize() { | 86 void ShellExtensionsClient::Initialize() { |
| 86 RegisterCommonManifestHandlers(); | 87 RegisterCommonManifestHandlers(); |
| 87 ManifestHandler::FinalizeRegistration(); | 88 ManifestHandler::FinalizeRegistration(); |
| 88 // TODO(jamescook): Do we need to whitelist any extensions? | 89 // TODO(jamescook): Do we need to whitelist any extensions? |
| 89 | 90 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return api::GeneratedSchemas::Get(name); | 175 return api::GeneratedSchemas::Get(name); |
| 175 } | 176 } |
| 176 | 177 |
| 177 bool ShellExtensionsClient::ShouldSuppressFatalErrors() const { | 178 bool ShellExtensionsClient::ShouldSuppressFatalErrors() const { |
| 178 return true; | 179 return true; |
| 179 } | 180 } |
| 180 | 181 |
| 181 void ShellExtensionsClient::RecordDidSuppressFatalError() { | 182 void ShellExtensionsClient::RecordDidSuppressFatalError() { |
| 182 } | 183 } |
| 183 | 184 |
| 184 std::string ShellExtensionsClient::GetWebstoreBaseURL() const { | 185 const GURL& ShellExtensionsClient::GetWebstoreBaseURL() const { |
| 185 return extension_urls::kChromeWebstoreBaseURL; | 186 return webstore_base_url_; |
| 186 } | 187 } |
| 187 | 188 |
| 188 const GURL& ShellExtensionsClient::GetWebstoreUpdateURL() const { | 189 const GURL& ShellExtensionsClient::GetWebstoreUpdateURL() const { |
| 189 return webstore_update_url_; | 190 return webstore_update_url_; |
| 190 } | 191 } |
| 191 | 192 |
| 192 bool ShellExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const { | 193 bool ShellExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const { |
| 193 // TODO(rockot): Maybe we want to do something else here. For now we accept | 194 // TODO(rockot): Maybe we want to do something else here. For now we accept |
| 194 // any URL as a blacklist URL because we don't really care. | 195 // any URL as a blacklist URL because we don't really care. |
| 195 return true; | 196 return true; |
| 196 } | 197 } |
| 197 | 198 |
| 198 } // namespace extensions | 199 } // namespace extensions |
| OLD | NEW |