OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_per_app.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/launcher/launcher_model.h" | 9 #include "ash/launcher/launcher_model.h" |
10 #include "ash/launcher/launcher_util.h" | 10 #include "ash/launcher/launcher_util.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "chrome/browser/ui/ash/launcher/launcher_app_tab_helper.h" | 32 #include "chrome/browser/ui/ash/launcher/launcher_app_tab_helper.h" |
33 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" | 33 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" |
34 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 34 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
35 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 35 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
36 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" | 36 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" |
37 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h
" | 37 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h
" |
38 #include "chrome/browser/ui/browser.h" | 38 #include "chrome/browser/ui/browser.h" |
39 #include "chrome/browser/ui/browser_commands.h" | 39 #include "chrome/browser/ui/browser_commands.h" |
40 #include "chrome/browser/ui/browser_finder.h" | 40 #include "chrome/browser/ui/browser_finder.h" |
41 #include "chrome/browser/ui/browser_list.h" | 41 #include "chrome/browser/ui/browser_list.h" |
| 42 #include "chrome/browser/ui/browser_list_impl.h" |
42 #include "chrome/browser/ui/browser_tabstrip.h" | 43 #include "chrome/browser/ui/browser_tabstrip.h" |
43 #include "chrome/browser/ui/browser_window.h" | 44 #include "chrome/browser/ui/browser_window.h" |
44 #include "chrome/browser/ui/extensions/application_launch.h" | 45 #include "chrome/browser/ui/extensions/application_launch.h" |
45 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 46 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
| 47 #include "chrome/browser/ui/host_desktop.h" |
46 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 48 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
47 #include "chrome/browser/web_applications/web_app.h" | 49 #include "chrome/browser/web_applications/web_app.h" |
48 #include "chrome/common/chrome_notification_types.h" | 50 #include "chrome/common/chrome_notification_types.h" |
49 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
50 #include "chrome/common/extensions/extension.h" | 52 #include "chrome/common/extensions/extension.h" |
51 #include "chrome/common/extensions/extension_resource.h" | 53 #include "chrome/common/extensions/extension_resource.h" |
52 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
53 #include "chrome/common/url_constants.h" | 55 #include "chrome/common/url_constants.h" |
54 #include "content/public/browser/navigation_entry.h" | 56 #include "content/public/browser/navigation_entry.h" |
55 #include "content/public/browser/notification_service.h" | 57 #include "content/public/browser/notification_service.h" |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 void ChromeLauncherControllerPerApp::UpdateBrowserItemStatus() { | 1065 void ChromeLauncherControllerPerApp::UpdateBrowserItemStatus() { |
1064 // Determine the new browser's active state and change if necessary. | 1066 // Determine the new browser's active state and change if necessary. |
1065 int browser_index = ash::launcher::GetBrowserItemIndex(*model_); | 1067 int browser_index = ash::launcher::GetBrowserItemIndex(*model_); |
1066 DCHECK(browser_index >= 0); | 1068 DCHECK(browser_index >= 0); |
1067 ash::LauncherItem browser_item = model_->items()[browser_index]; | 1069 ash::LauncherItem browser_item = model_->items()[browser_index]; |
1068 ash::LauncherItemStatus browser_status = browser_item.status; | 1070 ash::LauncherItemStatus browser_status = browser_item.status; |
1069 // See if the active window is a browser. | 1071 // See if the active window is a browser. |
1070 aura::Window* window = ash::wm::GetActiveWindow(); | 1072 aura::Window* window = ash::wm::GetActiveWindow(); |
1071 if (window && chrome::FindBrowserWithWindow(window)) { | 1073 if (window && chrome::FindBrowserWithWindow(window)) { |
1072 browser_status = ash::STATUS_ACTIVE; | 1074 browser_status = ash::STATUS_ACTIVE; |
1073 } else if (!BrowserList::empty()) { | 1075 } else if (!chrome::BrowserListImpl::GetInstance( |
| 1076 chrome::HOST_DESKTOP_TYPE_ASH)->empty()) { |
1074 browser_status = ash::STATUS_RUNNING; | 1077 browser_status = ash::STATUS_RUNNING; |
1075 } else { | 1078 } else { |
1076 browser_status = ash::STATUS_CLOSED; | 1079 browser_status = ash::STATUS_CLOSED; |
1077 } | 1080 } |
1078 if (browser_status != browser_item.status) { | 1081 if (browser_status != browser_item.status) { |
1079 browser_item.status = browser_status; | 1082 browser_item.status = browser_status; |
1080 model_->Set(browser_index, browser_item); | 1083 model_->Set(browser_index, browser_item); |
1081 } | 1084 } |
1082 } | 1085 } |
1083 | 1086 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 WebContents* web_contents = | 1342 WebContents* web_contents = |
1340 tab_strip->GetWebContentsAt(tab_strip->active_index()); | 1343 tab_strip->GetWebContentsAt(tab_strip->active_index()); |
1341 gfx::Image app_icon = GetAppListIcon(web_contents); | 1344 gfx::Image app_icon = GetAppListIcon(web_contents); |
1342 items.push_back(new ChromeLauncherAppMenuItemBrowser( | 1345 items.push_back(new ChromeLauncherAppMenuItemBrowser( |
1343 web_contents->GetTitle(), | 1346 web_contents->GetTitle(), |
1344 app_icon.IsEmpty() ? NULL : &app_icon, | 1347 app_icon.IsEmpty() ? NULL : &app_icon, |
1345 browser)); | 1348 browser)); |
1346 } | 1349 } |
1347 return items.Pass(); | 1350 return items.Pass(); |
1348 } | 1351 } |
OLD | NEW |