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

Unified Diff: ash/launcher/launcher_model.cc

Issue 22291003: ash:Shelf Update Alternate Layout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nl Created 7 years, 4 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 | « ash/launcher/launcher_button.cc ('k') | ash/launcher/launcher_view.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 8daf56178cf7019298a7ea3c77a6a5972e3ccc78..9607de6fcfe677e1786b4a2ed1cbe1c15963fbab 100644
--- a/ash/launcher/launcher_model.cc
+++ b/ash/launcher/launcher_model.cc
@@ -14,18 +14,34 @@ namespace ash {
namespace {
int LauncherItemTypeToWeight(LauncherItemType type) {
- switch (type) {
- case TYPE_BROWSER_SHORTCUT:
- case TYPE_APP_SHORTCUT:
- case TYPE_WINDOWED_APP:
- return 0;
- case TYPE_TABBED:
- case TYPE_PLATFORM_APP:
- return 1;
- case TYPE_APP_LIST:
- return ash::switches::UseAlternateShelfLayout() ? 0 : 2;
- case TYPE_APP_PANEL:
- return 3;
+ if (ash::switches::UseAlternateShelfLayout()) {
+ switch (type) {
+ case TYPE_APP_LIST:
+ return 0;
+ case TYPE_BROWSER_SHORTCUT:
+ case TYPE_APP_SHORTCUT:
+ case TYPE_WINDOWED_APP:
+ return 1;
+ case TYPE_TABBED:
+ case TYPE_PLATFORM_APP:
+ return 2;
+ case TYPE_APP_PANEL:
+ return 3;
+ }
+ } else {
+ switch (type) {
+ case TYPE_BROWSER_SHORTCUT:
+ case TYPE_APP_SHORTCUT:
+ case TYPE_WINDOWED_APP:
+ return 0;
+ case TYPE_TABBED:
+ case TYPE_PLATFORM_APP:
+ return 1;
+ case TYPE_APP_LIST:
+ return 2;
+ case TYPE_APP_PANEL:
+ return 3;
+ }
}
NOTREACHED() << "Invalid type " << type;
« no previous file with comments | « ash/launcher/launcher_button.cc ('k') | ash/launcher/launcher_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698