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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 98283004: Fixing problem with M33->M32->M33 transitions & pinned app preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1827 if (*chrome_index != -1 && 1827 if (*chrome_index != -1 &&
1828 *app_list_index < *chrome_index && 1828 *app_list_index < *chrome_index &&
1829 target_index > *chrome_index) 1829 target_index > *chrome_index)
1830 --(*chrome_index); 1830 --(*chrome_index);
1831 *app_list_index = -1; 1831 *app_list_index = -1;
1832 } 1832 }
1833 } 1833 }
1834 1834
1835 int ChromeLauncherController::FindInsertionPoint(bool is_app_list) { 1835 int ChromeLauncherController::FindInsertionPoint(bool is_app_list) {
1836 bool alternate = ash::switches::UseAlternateShelfLayout(); 1836 bool alternate = ash::switches::UseAlternateShelfLayout();
1837 // Keeping this change small to backport to M33&32 (see crbug.com/329597).
1838 // TODO(skuhne): With the removal of the legacy shelf layout we should remove
1839 // the ability to move the app list item since this was never used. We should
1840 // instead ask the ShelfModel::ValidateInsertionIndex or similir for an index.
Daniel Erat 2013/12/19 16:59:46 nit: s/similir/similar/
1841 if (is_app_list && alternate)
1842 return 0;
1843
1837 for (int i = model_->item_count() - 1; i > 0; --i) { 1844 for (int i = model_->item_count() - 1; i > 0; --i) {
1838 ash::LauncherItemType type = model_->items()[i].type; 1845 ash::LauncherItemType type = model_->items()[i].type;
1839 if (type == ash::TYPE_APP_SHORTCUT || 1846 if (type == ash::TYPE_APP_SHORTCUT ||
1840 ((is_app_list || alternate) && type == ash::TYPE_APP_LIST) || 1847 ((is_app_list || alternate) && type == ash::TYPE_APP_LIST) ||
1841 type == ash::TYPE_BROWSER_SHORTCUT || 1848 type == ash::TYPE_BROWSER_SHORTCUT ||
1842 type == ash::TYPE_WINDOWED_APP) 1849 type == ash::TYPE_WINDOWED_APP)
1843 return i; 1850 return i;
1844 } 1851 }
1845 return 0; 1852 return 0;
1846 } 1853 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 } 2022 }
2016 2023
2017 void ChromeLauncherController::ReleaseProfile() { 2024 void ChromeLauncherController::ReleaseProfile() {
2018 if (app_sync_ui_state_) 2025 if (app_sync_ui_state_)
2019 app_sync_ui_state_->RemoveObserver(this); 2026 app_sync_ui_state_->RemoveObserver(this);
2020 2027
2021 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); 2028 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this);
2022 2029
2023 pref_change_registrar_.RemoveAll(); 2030 pref_change_registrar_.RemoveAll();
2024 } 2031 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698