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

Unified Diff: ash/launcher/launcher_model.cc

Issue 10534142: Add support for pinning platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment Created 8 years, 6 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: ash/launcher/launcher_model.cc
diff --git a/ash/launcher/launcher_model.cc b/ash/launcher/launcher_model.cc
index 67d51e44edca110c305ec9f0919013e8a58ca5fa..50625fa516dd2ea99f226daa1c249de0af6771b7 100644
--- a/ash/launcher/launcher_model.cc
+++ b/ash/launcher/launcher_model.cc
@@ -93,9 +93,15 @@ void LauncherModel::Set(int index, const LauncherItem& item) {
LauncherItem old_item(items_[index]);
items_[index] = item;
items_[index].id = old_item.id;
- items_[index].type = old_item.type;
FOR_EACH_OBSERVER(LauncherModelObserver, observers_,
LauncherItemChanged(index, old_item));
+
+ // If the type changes confirm that the item is still in the right order.
+ if (items_[index].type != old_item.type) {
+ int new_index = ValidateInsertionIndex(items_[index].type, index);
sky 2012/06/13 21:20:53 By updating the item then validating you've broken
DaveMoore 2012/06/13 22:30:16 Done.
+ if (new_index != index)
+ Move(index, new_index);
+ }
}
int LauncherModel::ItemIndexByID(LauncherID id) {
« no previous file with comments | « no previous file | ash/launcher/launcher_view.cc » ('j') | chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698