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

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

Issue 368133005: Fixes for re-enabling more MSVC level 4 warnings: chrome/browser/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comment Created 6 years, 5 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
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/external_install_error.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_toolbar_model.cc
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc
index 4e1a472ff29b9f1c8d99e2c210ebd31e095fb78b..b4d223c1c76aa9c683315c6cd8dd5f8ac5836a5d 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -256,7 +256,8 @@ size_t ExtensionToolbarModel::FindNewPositionFromLastKnownGood(
}
}
- return -1;
+ // Position not found.
+ return toolbar_items_.size();
}
void ExtensionToolbarModel::AddExtension(const Extension* extension) {
@@ -264,7 +265,7 @@ void ExtensionToolbarModel::AddExtension(const Extension* extension) {
if (!ExtensionActionManager::Get(profile_)->GetBrowserAction(*extension))
return;
- size_t new_index = -1;
+ size_t new_index = toolbar_items_.size();
// See if we have a last known good position for this extension.
ExtensionIdList::iterator last_pos = std::find(last_known_positions_.begin(),
@@ -280,10 +281,9 @@ void ExtensionToolbarModel::AddExtension(const Extension* extension) {
}
} else {
// This is a never before seen extension, that was added to the end. Make
- // sure to reflect that.
+ // sure to reflect that. (|new_index| was set above.)
toolbar_items_.push_back(make_scoped_refptr(extension));
last_known_positions_.push_back(extension->id());
- new_index = toolbar_items_.size() - 1;
UpdatePrefs();
}
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/external_install_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698