OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |