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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 140323010: Ash:Shelf - Cleanup of Alternate Shelf (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« ash/system/tray/tray_background_view.cc ('K') | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
index 824c74fc30cc66999fb3a560a48b5e9560dfaa29..16f297b8119fbd75b7a40e048c795853ef9e6138 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -1121,8 +1121,7 @@ void ChromeLauncherController::ShelfItemAdded(int index) {
// The app list launcher can get added to the shelf after we applied the
// preferences. In that case the item might be at the wrong spot. As such we
// call the function again.
- if (model_->items()[index].type == ash::TYPE_APP_LIST &&
- ash::switches::UseAlternateShelfLayout())
+ if (model_->items()[index].type == ash::TYPE_APP_LIST)
UpdateAppLaunchersFromPref();
}
@@ -1135,8 +1134,7 @@ void ChromeLauncherController::ShelfItemMoved(int start_index,
// We remember the moved item position if it is either pinnable or
// it is the app list with the alternate shelf layout.
if ((HasItemController(item.id) && IsPinned(item.id)) ||
- (ash::switches::UseAlternateShelfLayout() &&
- item.type == ash::TYPE_APP_LIST))
+ item.type == ash::TYPE_APP_LIST)
PersistPinnedState();
}
@@ -1877,18 +1875,17 @@ void ChromeLauncherController::MoveChromeOrApplistToFinalPosition(
}
int ChromeLauncherController::FindInsertionPoint(bool is_app_list) {
- bool alternate = ash::switches::UseAlternateShelfLayout();
// Keeping this change small to backport to M33&32 (see crbug.com/329597).
// TODO(skuhne): With the removal of the legacy shelf layout we should remove
// the ability to move the app list item since this was never used. We should
// instead ask the ShelfModel::ValidateInsertionIndex or similir for an index.
- if (is_app_list && alternate)
+ if (is_app_list)
return 0;
for (int i = model_->item_count() - 1; i > 0; --i) {
ash::LauncherItemType type = model_->items()[i].type;
if (type == ash::TYPE_APP_SHORTCUT ||
- ((is_app_list || alternate) && type == ash::TYPE_APP_LIST) ||
+ type == ash::TYPE_APP_LIST ||
type == ash::TYPE_BROWSER_SHORTCUT ||
type == ash::TYPE_WINDOWED_APP)
return i;
@@ -1977,12 +1974,8 @@ ChromeLauncherController::GetListOfPinnedAppsAndBrowser() {
// If not added yet, add the app list item either at the end or at the
// beginning - depending on the shelf layout.
- if (!app_list_icon_added) {
- if (ash::switches::UseAlternateShelfLayout())
- pinned_apps.insert(pinned_apps.begin(), kAppLauncherIdPlaceholder);
- else
- pinned_apps.push_back(kAppLauncherIdPlaceholder);
- }
+ if (!app_list_icon_added)
+ pinned_apps.insert(pinned_apps.begin(), kAppLauncherIdPlaceholder);
return pinned_apps;
}
« ash/system/tray/tray_background_view.cc ('K') | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698