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

Unified Diff: ash/launcher/launcher_model.cc

Issue 11348201: Align panel icons on the right / end. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO for panel overflow. Created 8 years, 1 month 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 | « ash/launcher/launcher_model.h ('k') | ash/launcher/launcher_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ash/launcher/launcher_model.h ('k') | ash/launcher/launcher_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698