| 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/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 std::string page = iter.key(); | 274 std::string page = iter.key(); |
| 275 std::string val; | 275 std::string val; |
| 276 // Restrict override pages to a list of supported URLs. | 276 // Restrict override pages to a list of supported URLs. |
| 277 bool is_override = (page != chrome::kChromeUINewTabHost && | 277 bool is_override = (page != chrome::kChromeUINewTabHost && |
| 278 page != chrome::kChromeUIBookmarksHost && | 278 page != chrome::kChromeUIBookmarksHost && |
| 279 page != chrome::kChromeUIHistoryHost); | 279 page != chrome::kChromeUIHistoryHost); |
| 280 #if defined(OS_CHROMEOS) | 280 #if defined(OS_CHROMEOS) |
| 281 is_override = (is_override && | 281 is_override = (is_override && |
| 282 page != chrome::kChromeUIActivationMessageHost); | 282 page != chrome::kChromeUIActivationMessageHost); |
| 283 #endif | 283 #endif |
| 284 #if defined(FILE_MANAGER_EXTENSION) | |
| 285 is_override = (is_override && | |
| 286 !(extension->location() == Manifest::COMPONENT && | |
| 287 page == chrome::kChromeUIFileManagerHost)); | |
| 288 #endif | |
| 289 #if defined(OS_CHROMEOS) | 284 #if defined(OS_CHROMEOS) |
| 290 is_override = (is_override && page != keyboard::kKeyboardWebUIHost); | 285 is_override = (is_override && page != keyboard::kKeyboardWebUIHost); |
| 291 #endif | 286 #endif |
| 292 #if defined(ENABLE_ENHANCED_BOOKMARKS) | 287 #if defined(ENABLE_ENHANCED_BOOKMARKS) |
| 293 is_override = (is_override && | 288 is_override = (is_override && |
| 294 !(extension->location() == Manifest::COMPONENT && | 289 !(extension->location() == Manifest::COMPONENT && |
| 295 page == chrome::kChromeUIEnhancedBookmarksHost)); | 290 page == chrome::kChromeUIEnhancedBookmarksHost)); |
| 296 #endif | 291 #endif |
| 297 | 292 |
| 298 if (is_override || !iter.value().GetAsString(&val)) { | 293 if (is_override || !iter.value().GetAsString(&val)) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 325 extension->SetManifestData(keys::kChromeURLOverrides, | 320 extension->SetManifestData(keys::kChromeURLOverrides, |
| 326 url_overrides.release()); | 321 url_overrides.release()); |
| 327 return true; | 322 return true; |
| 328 } | 323 } |
| 329 | 324 |
| 330 const std::vector<std::string> URLOverridesHandler::Keys() const { | 325 const std::vector<std::string> URLOverridesHandler::Keys() const { |
| 331 return SingleKey(keys::kChromeURLOverrides); | 326 return SingleKey(keys::kChromeURLOverrides); |
| 332 } | 327 } |
| 333 | 328 |
| 334 } // namespace extensions | 329 } // namespace extensions |
| OLD | NEW |