Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(966)

Unified Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 7618021: base: Fix the TODO in ListValue::Remove(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_web_ui.cc
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index dd401924c0895d1fe5a3ca6792238ed60f6f16f2..67999de390802e0307a557dd49c2c40a28b602ff 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -332,9 +332,12 @@ void ExtensionWebUI::RegisterChromeURLOverrides(
// static
void ExtensionWebUI::UnregisterAndReplaceOverride(const std::string& page,
- Profile* profile, ListValue* list, Value* override) {
- int index = list->Remove(*override);
- if (index == 0) {
+ Profile* profile,
+ ListValue* list,
+ Value* override) {
+ size_t index = 0;
+ bool found = list->Remove(*override, &index);
+ if (found && index == 0) {
// This is the active override, so we need to find all existing
// tabs for this override and get them to reload the original URL.
for (TabContentsIterator iterator; !iterator.done(); ++iterator) {

Powered by Google App Engine
This is Rietveld 408576698