| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/common/extensions/manifest_url_handler.h" | 5 #include "chrome/common/extensions/manifest_url_handler.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 page != chrome::kChromeUIHistoryHost); | 266 page != chrome::kChromeUIHistoryHost); |
| 267 #if defined(OS_CHROMEOS) | 267 #if defined(OS_CHROMEOS) |
| 268 is_override = (is_override && | 268 is_override = (is_override && |
| 269 page != chrome::kChromeUIActivationMessageHost); | 269 page != chrome::kChromeUIActivationMessageHost); |
| 270 #endif | 270 #endif |
| 271 #if defined(FILE_MANAGER_EXTENSION) | 271 #if defined(FILE_MANAGER_EXTENSION) |
| 272 is_override = (is_override && | 272 is_override = (is_override && |
| 273 !(extension->location() == Manifest::COMPONENT && | 273 !(extension->location() == Manifest::COMPONENT && |
| 274 page == chrome::kChromeUIFileManagerHost)); | 274 page == chrome::kChromeUIFileManagerHost)); |
| 275 #endif | 275 #endif |
| 276 // FIXME(bryeung): figure out where this should be enabled |
| 277 is_override = (is_override && |
| 278 page != chrome::kChromeUIVirtualKeyboardHost); |
| 276 | 279 |
| 277 if (is_override || !iter.value().GetAsString(&val)) { | 280 if (is_override || !iter.value().GetAsString(&val)) { |
| 278 *error = ASCIIToUTF16(errors::kInvalidChromeURLOverrides); | 281 *error = ASCIIToUTF16(errors::kInvalidChromeURLOverrides); |
| 279 return false; | 282 return false; |
| 280 } | 283 } |
| 281 // Replace the entry with a fully qualified chrome-extension:// URL. | 284 // Replace the entry with a fully qualified chrome-extension:// URL. |
| 282 url_overrides->chrome_url_overrides_[page] = extension->GetResourceURL(val); | 285 url_overrides->chrome_url_overrides_[page] = extension->GetResourceURL(val); |
| 283 | 286 |
| 284 // For component extensions, add override URL to extent patterns. | 287 // For component extensions, add override URL to extent patterns. |
| 285 if (extension->is_legacy_packaged_app() && | 288 if (extension->is_legacy_packaged_app() && |
| (...skipping 18 matching lines...) Expand all Loading... |
| 304 extension->SetManifestData(keys::kChromeURLOverrides, | 307 extension->SetManifestData(keys::kChromeURLOverrides, |
| 305 url_overrides.release()); | 308 url_overrides.release()); |
| 306 return true; | 309 return true; |
| 307 } | 310 } |
| 308 | 311 |
| 309 const std::vector<std::string> URLOverridesHandler::Keys() const { | 312 const std::vector<std::string> URLOverridesHandler::Keys() const { |
| 310 return SingleKey(keys::kChromeURLOverrides); | 313 return SingleKey(keys::kChromeURLOverrides); |
| 311 } | 314 } |
| 312 | 315 |
| 313 } // namespace extensions | 316 } // namespace extensions |
| OLD | NEW |