| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_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/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/ui/browser.h" | 36 #include "chrome/browser/ui/browser.h" |
| 37 #include "chrome/browser/ui/browser_commands.h" | 37 #include "chrome/browser/ui/browser_commands.h" |
| 38 #include "chrome/browser/ui/browser_finder.h" | 38 #include "chrome/browser/ui/browser_finder.h" |
| 39 #include "chrome/browser/ui/browser_list.h" | 39 #include "chrome/browser/ui/browser_list.h" |
| 40 #include "chrome/browser/ui/browser_tabstrip.h" | 40 #include "chrome/browser/ui/browser_tabstrip.h" |
| 41 #include "chrome/browser/ui/browser_window.h" | 41 #include "chrome/browser/ui/browser_window.h" |
| 42 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 42 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 43 #include "chrome/browser/web_applications/web_app.h" | 43 #include "chrome/browser/web_applications/web_app.h" |
| 44 #include "chrome/common/chrome_notification_types.h" | 44 #include "chrome/common/chrome_notification_types.h" |
| 45 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
| 46 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 46 #include "chrome/common/extensions/extension.h" | 47 #include "chrome/common/extensions/extension.h" |
| 47 #include "chrome/common/extensions/extension_resource.h" | 48 #include "chrome/common/extensions/extension_resource.h" |
| 48 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
| 49 #include "chrome/common/url_constants.h" | 50 #include "chrome/common/url_constants.h" |
| 50 #include "content/public/browser/navigation_entry.h" | 51 #include "content/public/browser/navigation_entry.h" |
| 51 #include "content/public/browser/notification_service.h" | 52 #include "content/public/browser/notification_service.h" |
| 52 #include "content/public/browser/web_contents.h" | 53 #include "content/public/browser/web_contents.h" |
| 53 #include "extensions/common/url_pattern.h" | 54 #include "extensions/common/url_pattern.h" |
| 54 #include "grit/ash_resources.h" | 55 #include "grit/ash_resources.h" |
| 55 #include "grit/chromium_strings.h" | 56 #include "grit/chromium_strings.h" |
| (...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 int index) { | 1194 int index) { |
| 1194 ash::LauncherID id = model_->next_id(); | 1195 ash::LauncherID id = model_->next_id(); |
| 1195 DCHECK(!HasItemController(id)); | 1196 DCHECK(!HasItemController(id)); |
| 1196 DCHECK(controller); | 1197 DCHECK(controller); |
| 1197 id_to_item_controller_map_[id] = controller; | 1198 id_to_item_controller_map_[id] = controller; |
| 1198 controller->set_launcher_id(id); | 1199 controller->set_launcher_id(id); |
| 1199 | 1200 |
| 1200 ash::LauncherItem item; | 1201 ash::LauncherItem item; |
| 1201 item.type = controller->GetLauncherItemType(); | 1202 item.type = controller->GetLauncherItemType(); |
| 1202 item.is_incognito = false; | 1203 item.is_incognito = false; |
| 1203 item.image = Extension::GetDefaultIcon(true); | 1204 item.image = extensions::IconsInfo::GetDefaultAppIcon(); |
| 1204 | 1205 |
| 1205 WebContents* active_tab = GetLastActiveWebContents(app_id); | 1206 WebContents* active_tab = GetLastActiveWebContents(app_id); |
| 1206 if (active_tab) { | 1207 if (active_tab) { |
| 1207 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); | 1208 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); |
| 1208 DCHECK(browser); | 1209 DCHECK(browser); |
| 1209 if (browser->window()->IsActive()) | 1210 if (browser->window()->IsActive()) |
| 1210 status = ash::STATUS_ACTIVE; | 1211 status = ash::STATUS_ACTIVE; |
| 1211 else | 1212 else |
| 1212 status = ash::STATUS_RUNNING; | 1213 status = ash::STATUS_RUNNING; |
| 1213 } | 1214 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 WebContents* web_contents = | 1253 WebContents* web_contents = |
| 1253 tab_strip->GetWebContentsAt(tab_strip->active_index()); | 1254 tab_strip->GetWebContentsAt(tab_strip->active_index()); |
| 1254 gfx::Image app_icon = GetAppListIcon(web_contents); | 1255 gfx::Image app_icon = GetAppListIcon(web_contents); |
| 1255 items->push_back(new ChromeLauncherAppMenuItemBrowser( | 1256 items->push_back(new ChromeLauncherAppMenuItemBrowser( |
| 1256 web_contents->GetTitle(), | 1257 web_contents->GetTitle(), |
| 1257 app_icon.IsEmpty() ? NULL : &app_icon, | 1258 app_icon.IsEmpty() ? NULL : &app_icon, |
| 1258 browser)); | 1259 browser)); |
| 1259 } | 1260 } |
| 1260 return items; | 1261 return items; |
| 1261 } | 1262 } |
| OLD | NEW |