Index: ash/launcher/launcher_model.cc |
diff --git a/ash/launcher/launcher_model.cc b/ash/launcher/launcher_model.cc |
index 7f6e113ff16f326a8774ce95d295e91c91cbc543..3c1e768f2748e3625aa3ed873af27346eecc0f9c 100644 |
--- a/ash/launcher/launcher_model.cc |
+++ b/ash/launcher/launcher_model.cc |
@@ -19,11 +19,12 @@ int LauncherItemTypeToWeight(LauncherItemType type) { |
case TYPE_APP_SHORTCUT: |
return 1; |
case TYPE_TABBED: |
- case TYPE_APP_PANEL: |
case TYPE_PLATFORM_APP: |
return 2; |
case TYPE_APP_LIST: |
return 3; |
+ case TYPE_APP_PANEL: |
+ return 4; |
} |
NOTREACHED() << "Invalid type " << type; |
@@ -117,6 +118,13 @@ LauncherItems::const_iterator LauncherModel::ItemByID(int id) const { |
return items_.end(); |
} |
+int LauncherModel::FirstPanelIndex() const { |
+ LauncherItem weight_dummy; |
+ weight_dummy.type = TYPE_APP_PANEL; |
+ return std::lower_bound(items_.begin(), items_.end(), weight_dummy, |
+ CompareByWeight) - items_.begin(); |
+} |
+ |
void LauncherModel::SetStatus(Status status) { |
if (status_ == status) |
return; |