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" |
11 #include "ash/launcher/launcher.h" | 11 #include "ash/launcher/launcher.h" |
12 #include "ash/launcher/launcher_item_delegate_manager.h" | 12 #include "ash/launcher/launcher_item_delegate_manager.h" |
13 #include "ash/launcher/launcher_model.h" | 13 #include "ash/launcher/launcher_model.h" |
14 #include "ash/launcher/launcher_model_util.h" | |
15 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
16 #include "ash/shelf/shelf_layout_manager.h" | 15 #include "ash/shelf/shelf_layout_manager.h" |
| 16 #include "ash/shelf/shelf_model_util.h" |
17 #include "ash/shelf/shelf_widget.h" | 17 #include "ash/shelf/shelf_widget.h" |
18 #include "ash/shell.h" | 18 #include "ash/shell.h" |
19 #include "ash/wm/window_util.h" | 19 #include "ash/wm/window_util.h" |
20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
21 #include "base/prefs/scoped_user_pref_update.h" | 21 #include "base/prefs/scoped_user_pref_update.h" |
22 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
24 #include "base/values.h" | 24 #include "base/values.h" |
25 #include "chrome/browser/app_mode/app_mode_utils.h" | 25 #include "chrome/browser/app_mode/app_mode_utils.h" |
26 #include "chrome/browser/chrome_notification_types.h" | 26 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 window->Minimize(); | 1056 window->Minimize(); |
1057 } | 1057 } |
1058 } else { | 1058 } else { |
1059 window->Show(); | 1059 window->Show(); |
1060 window->Activate(); | 1060 window->Activate(); |
1061 } | 1061 } |
1062 } | 1062 } |
1063 | 1063 |
1064 ash::LauncherID ChromeLauncherController::GetIDByWindow(aura::Window* window) { | 1064 ash::LauncherID ChromeLauncherController::GetIDByWindow(aura::Window* window) { |
1065 int browser_index = | 1065 int browser_index = |
1066 ash::GetLauncherItemIndexForType(ash::TYPE_BROWSER_SHORTCUT, *model_); | 1066 ash::GetShelfItemIndexForType(ash::TYPE_BROWSER_SHORTCUT, *model_); |
1067 DCHECK_GE(browser_index, 0); | 1067 DCHECK_GE(browser_index, 0); |
1068 ash::LauncherID browser_id = model_->items()[browser_index].id; | 1068 ash::LauncherID browser_id = model_->items()[browser_index].id; |
1069 | 1069 |
1070 IDToItemControllerMap::const_iterator i = id_to_item_controller_map_.begin(); | 1070 IDToItemControllerMap::const_iterator i = id_to_item_controller_map_.begin(); |
1071 for (; i != id_to_item_controller_map_.end(); ++i) { | 1071 for (; i != id_to_item_controller_map_.end(); ++i) { |
1072 // Since a |window| can be used by multiple applications, an explicit | 1072 // Since a |window| can be used by multiple applications, an explicit |
1073 // application always gets chosen over the generic browser. | 1073 // application always gets chosen over the generic browser. |
1074 if (i->first != browser_id && i->second->IsCurrentlyShownInWindow(window)) | 1074 if (i->first != browser_id && i->second->IsCurrentlyShownInWindow(window)) |
1075 return i->first; | 1075 return i->first; |
1076 } | 1076 } |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2055 } | 2055 } |
2056 } | 2056 } |
2057 } | 2057 } |
2058 } | 2058 } |
2059 | 2059 |
2060 // Finally we update the browser state itself. | 2060 // Finally we update the browser state itself. |
2061 browser_status_monitor_->UpdateBrowserItemState(); | 2061 browser_status_monitor_->UpdateBrowserItemState(); |
2062 #endif | 2062 #endif |
2063 } | 2063 } |
2064 | 2064 |
OLD | NEW |