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) { |