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

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

Issue 27369004: Change GetBrowserItemIndex() to GetLauncherItemIndexForType() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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 unified diff | Download patch
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 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 } else { 954 } else {
955 window->Minimize(); 955 window->Minimize();
956 } 956 }
957 } else { 957 } else {
958 window->Show(); 958 window->Show();
959 window->Activate(); 959 window->Activate();
960 } 960 }
961 } 961 }
962 962
963 ash::LauncherID ChromeLauncherController::GetIDByWindow(aura::Window* window) { 963 ash::LauncherID ChromeLauncherController::GetIDByWindow(aura::Window* window) {
964 int browser_index = ash::GetBrowserItemIndex(*model_); 964 int browser_index =
965 ash::GetLauncherItemIndexForType(ash::TYPE_BROWSER_SHORTCUT, *model_);
965 DCHECK_GE(browser_index, 0); 966 DCHECK_GE(browser_index, 0);
966 ash::LauncherID browser_id = model_->items()[browser_index].id; 967 ash::LauncherID browser_id = model_->items()[browser_index].id;
967 968
968 IDToItemControllerMap::const_iterator i = id_to_item_controller_map_.begin(); 969 IDToItemControllerMap::const_iterator i = id_to_item_controller_map_.begin();
969 for (; i != id_to_item_controller_map_.end(); ++i) { 970 for (; i != id_to_item_controller_map_.end(); ++i) {
970 // Since a |window| can be used by multiple applications, an explicit 971 // Since a |window| can be used by multiple applications, an explicit
971 // application always gets chosen over the generic browser. 972 // application always gets chosen over the generic browser.
972 if (i->first != browser_id && i->second->IsCurrentlyShownInWindow(window)) 973 if (i->first != browser_id && i->second->IsCurrentlyShownInWindow(window))
973 return i->first; 974 return i->first;
974 } 975 }
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 } 1880 }
1880 1881
1881 void ChromeLauncherController::ReleaseProfile() { 1882 void ChromeLauncherController::ReleaseProfile() {
1882 if (app_sync_ui_state_) 1883 if (app_sync_ui_state_)
1883 app_sync_ui_state_->RemoveObserver(this); 1884 app_sync_ui_state_->RemoveObserver(this);
1884 1885
1885 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); 1886 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this);
1886 1887
1887 pref_change_registrar_.RemoveAll(); 1888 pref_change_registrar_.RemoveAll();
1888 } 1889 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698