| 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/test/test_extensions_client.h" | 5 #include "extensions/test/test_extensions_client.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "extensions/common/api/generated_schemas.h" | 8 #include "extensions/common/api/generated_schemas.h" |
| 9 #include "extensions/common/common_manifest_handlers.h" | 9 #include "extensions/common/common_manifest_handlers.h" |
| 10 #include "extensions/common/extension_urls.h" | 10 #include "extensions/common/extension_urls.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 template <class FeatureClass> | 33 template <class FeatureClass> |
| 34 SimpleFeature* CreateFeature() { | 34 SimpleFeature* CreateFeature() { |
| 35 return new FeatureClass; | 35 return new FeatureClass; |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 TestExtensionsClient::TestExtensionsClient() | 40 TestExtensionsClient::TestExtensionsClient() |
| 41 : webstore_update_url_(extension_urls::kChromeWebstoreUpdateURL) {} | 41 : webstore_base_url_(extension_urls::kChromeWebstoreBaseURL), |
| 42 webstore_update_url_(extension_urls::kChromeWebstoreUpdateURL) {} |
| 42 | 43 |
| 43 TestExtensionsClient::~TestExtensionsClient() { | 44 TestExtensionsClient::~TestExtensionsClient() { |
| 44 } | 45 } |
| 45 | 46 |
| 46 void TestExtensionsClient::AddBrowserImagePathsFilter( | 47 void TestExtensionsClient::AddBrowserImagePathsFilter( |
| 47 BrowserImagePathsFilter* filter) { | 48 BrowserImagePathsFilter* filter) { |
| 48 browser_image_filters_.insert(filter); | 49 browser_image_filters_.insert(filter); |
| 49 } | 50 } |
| 50 | 51 |
| 51 void TestExtensionsClient::RemoveBrowserImagePathsFilter( | 52 void TestExtensionsClient::RemoveBrowserImagePathsFilter( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return api::GeneratedSchemas::Get(name); | 141 return api::GeneratedSchemas::Get(name); |
| 141 } | 142 } |
| 142 | 143 |
| 143 bool TestExtensionsClient::ShouldSuppressFatalErrors() const { | 144 bool TestExtensionsClient::ShouldSuppressFatalErrors() const { |
| 144 return true; | 145 return true; |
| 145 } | 146 } |
| 146 | 147 |
| 147 void TestExtensionsClient::RecordDidSuppressFatalError() { | 148 void TestExtensionsClient::RecordDidSuppressFatalError() { |
| 148 } | 149 } |
| 149 | 150 |
| 150 std::string TestExtensionsClient::GetWebstoreBaseURL() const { | 151 const GURL& TestExtensionsClient::GetWebstoreBaseURL() const { |
| 151 return extension_urls::kChromeWebstoreBaseURL; | 152 return webstore_base_url_; |
| 152 } | 153 } |
| 153 | 154 |
| 154 const GURL& TestExtensionsClient::GetWebstoreUpdateURL() const { | 155 const GURL& TestExtensionsClient::GetWebstoreUpdateURL() const { |
| 155 return webstore_update_url_; | 156 return webstore_update_url_; |
| 156 } | 157 } |
| 157 | 158 |
| 158 bool TestExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const { | 159 bool TestExtensionsClient::IsBlacklistUpdateURL(const GURL& url) const { |
| 159 return false; | 160 return false; |
| 160 } | 161 } |
| 161 | 162 |
| 162 std::set<base::FilePath> TestExtensionsClient::GetBrowserImagePaths( | 163 std::set<base::FilePath> TestExtensionsClient::GetBrowserImagePaths( |
| 163 const Extension* extension) { | 164 const Extension* extension) { |
| 164 std::set<base::FilePath> result = | 165 std::set<base::FilePath> result = |
| 165 ExtensionsClient::GetBrowserImagePaths(extension); | 166 ExtensionsClient::GetBrowserImagePaths(extension); |
| 166 for (auto* filter : browser_image_filters_) | 167 for (auto* filter : browser_image_filters_) |
| 167 filter->Filter(extension, &result); | 168 filter->Filter(extension, &result); |
| 168 return result; | 169 return result; |
| 169 } | 170 } |
| 170 | 171 |
| 171 } // namespace extensions | 172 } // namespace extensions |
| OLD | NEW |