| 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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 } else { | 950 } else { |
| 951 window->Minimize(); | 951 window->Minimize(); |
| 952 } | 952 } |
| 953 } else { | 953 } else { |
| 954 window->Show(); | 954 window->Show(); |
| 955 window->Activate(); | 955 window->Activate(); |
| 956 } | 956 } |
| 957 } | 957 } |
| 958 | 958 |
| 959 ash::LauncherID ChromeLauncherController::GetIDByWindow(aura::Window* window) { | 959 ash::LauncherID ChromeLauncherController::GetIDByWindow(aura::Window* window) { |
| 960 int browser_index = ash::GetBrowserItemIndex(*model_); | 960 int browser_index = |
| 961 ash::GetLauncherItemIndexForType(ash::TYPE_BROWSER_SHORTCUT, *model_); |
| 961 DCHECK_GE(browser_index, 0); | 962 DCHECK_GE(browser_index, 0); |
| 962 ash::LauncherID browser_id = model_->items()[browser_index].id; | 963 ash::LauncherID browser_id = model_->items()[browser_index].id; |
| 963 | 964 |
| 964 IDToItemControllerMap::const_iterator i = id_to_item_controller_map_.begin(); | 965 IDToItemControllerMap::const_iterator i = id_to_item_controller_map_.begin(); |
| 965 for (; i != id_to_item_controller_map_.end(); ++i) { | 966 for (; i != id_to_item_controller_map_.end(); ++i) { |
| 966 // Since a |window| can be used by multiple applications, an explicit | 967 // Since a |window| can be used by multiple applications, an explicit |
| 967 // application always gets chosen over the generic browser. | 968 // application always gets chosen over the generic browser. |
| 968 if (i->first != browser_id && i->second->IsCurrentlyShownInWindow(window)) | 969 if (i->first != browser_id && i->second->IsCurrentlyShownInWindow(window)) |
| 969 return i->first; | 970 return i->first; |
| 970 } | 971 } |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1875 } | 1876 } |
| 1876 | 1877 |
| 1877 void ChromeLauncherController::ReleaseProfile() { | 1878 void ChromeLauncherController::ReleaseProfile() { |
| 1878 if (app_sync_ui_state_) | 1879 if (app_sync_ui_state_) |
| 1879 app_sync_ui_state_->RemoveObserver(this); | 1880 app_sync_ui_state_->RemoveObserver(this); |
| 1880 | 1881 |
| 1881 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); | 1882 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); |
| 1882 | 1883 |
| 1883 pref_change_registrar_.RemoveAll(); | 1884 pref_change_registrar_.RemoveAll(); |
| 1884 } | 1885 } |
| OLD | NEW |