Chromium Code Reviews| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 } | 269 } |
| 270 scoped_ptr<URLOverrides> url_overrides(new URLOverrides); | 270 scoped_ptr<URLOverrides> url_overrides(new URLOverrides); |
| 271 // Validate that the overrides are all strings | 271 // Validate that the overrides are all strings |
| 272 for (base::DictionaryValue::Iterator iter(*overrides); !iter.IsAtEnd(); | 272 for (base::DictionaryValue::Iterator iter(*overrides); !iter.IsAtEnd(); |
| 273 iter.Advance()) { | 273 iter.Advance()) { |
| 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 #if defined(ENABLE_ENHANCED_BOOKMARKS) | |
| 280 page != chrome::kChromeUIEnhancedBookmarksHost && | |
| 281 #endif | |
|
not at google - send to devlin
2013/10/01 00:21:01
so you're going to prevent extensions from overrid
Mike Wittman
2013/10/01 17:56:06
Yes, added a check so that only component extensio
| |
| 279 page != chrome::kChromeUIHistoryHost); | 282 page != chrome::kChromeUIHistoryHost); |
| 280 #if defined(OS_CHROMEOS) | 283 #if defined(OS_CHROMEOS) |
| 281 is_override = (is_override && | 284 is_override = (is_override && |
| 282 page != chrome::kChromeUIActivationMessageHost); | 285 page != chrome::kChromeUIActivationMessageHost); |
| 283 #endif | 286 #endif |
| 284 #if defined(FILE_MANAGER_EXTENSION) | 287 #if defined(FILE_MANAGER_EXTENSION) |
| 285 is_override = (is_override && | 288 is_override = (is_override && |
| 286 !(extension->location() == Manifest::COMPONENT && | 289 !(extension->location() == Manifest::COMPONENT && |
| 287 page == chrome::kChromeUIFileManagerHost)); | 290 page == chrome::kChromeUIFileManagerHost)); |
| 288 #endif | 291 #endif |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 extension->SetManifestData(keys::kChromeURLOverrides, | 323 extension->SetManifestData(keys::kChromeURLOverrides, |
| 321 url_overrides.release()); | 324 url_overrides.release()); |
| 322 return true; | 325 return true; |
| 323 } | 326 } |
| 324 | 327 |
| 325 const std::vector<std::string> URLOverridesHandler::Keys() const { | 328 const std::vector<std::string> URLOverridesHandler::Keys() const { |
| 326 return SingleKey(keys::kChromeURLOverrides); | 329 return SingleKey(keys::kChromeURLOverrides); |
| 327 } | 330 } |
| 328 | 331 |
| 329 } // namespace extensions | 332 } // namespace extensions |
| OLD | NEW |