| 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_browser.
h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.
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 18 matching lines...) Expand all Loading... |
| 30 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" | 30 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" |
| 31 #include "chrome/browser/ui/browser.h" | 31 #include "chrome/browser/ui/browser.h" |
| 32 #include "chrome/browser/ui/browser_commands.h" | 32 #include "chrome/browser/ui/browser_commands.h" |
| 33 #include "chrome/browser/ui/browser_finder.h" | 33 #include "chrome/browser/ui/browser_finder.h" |
| 34 #include "chrome/browser/ui/browser_tabstrip.h" | 34 #include "chrome/browser/ui/browser_tabstrip.h" |
| 35 #include "chrome/browser/ui/browser_window.h" | 35 #include "chrome/browser/ui/browser_window.h" |
| 36 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 36 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 37 #include "chrome/browser/web_applications/web_app.h" | 37 #include "chrome/browser/web_applications/web_app.h" |
| 38 #include "chrome/common/chrome_notification_types.h" | 38 #include "chrome/common/chrome_notification_types.h" |
| 39 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
| 40 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 40 #include "chrome/common/extensions/extension.h" | 41 #include "chrome/common/extensions/extension.h" |
| 41 #include "chrome/common/extensions/extension_resource.h" | 42 #include "chrome/common/extensions/extension_resource.h" |
| 42 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 43 #include "chrome/common/url_constants.h" | 44 #include "chrome/common/url_constants.h" |
| 44 #include "content/public/browser/navigation_entry.h" | 45 #include "content/public/browser/navigation_entry.h" |
| 45 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 46 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
| 47 #include "extensions/common/url_pattern.h" | 48 #include "extensions/common/url_pattern.h" |
| 48 #include "grit/theme_resources.h" | 49 #include "grit/theme_resources.h" |
| 49 #include "ui/aura/root_window.h" | 50 #include "ui/aura/root_window.h" |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 int index) { | 1159 int index) { |
| 1159 ash::LauncherID id = model_->next_id(); | 1160 ash::LauncherID id = model_->next_id(); |
| 1160 DCHECK(!HasItemController(id)); | 1161 DCHECK(!HasItemController(id)); |
| 1161 DCHECK(controller); | 1162 DCHECK(controller); |
| 1162 id_to_item_controller_map_[id] = controller; | 1163 id_to_item_controller_map_[id] = controller; |
| 1163 controller->set_launcher_id(id); | 1164 controller->set_launcher_id(id); |
| 1164 | 1165 |
| 1165 ash::LauncherItem item; | 1166 ash::LauncherItem item; |
| 1166 item.type = controller->GetLauncherItemType(); | 1167 item.type = controller->GetLauncherItemType(); |
| 1167 item.is_incognito = false; | 1168 item.is_incognito = false; |
| 1168 item.image = Extension::GetDefaultIcon(true); | 1169 item.image = extensions::IconsInfo::GetDefaultAppIcon(); |
| 1169 | 1170 |
| 1170 WebContents* active_tab = GetLastActiveWebContents(app_id); | 1171 WebContents* active_tab = GetLastActiveWebContents(app_id); |
| 1171 if (active_tab) { | 1172 if (active_tab) { |
| 1172 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); | 1173 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); |
| 1173 DCHECK(browser); | 1174 DCHECK(browser); |
| 1174 if (browser->window()->IsActive()) | 1175 if (browser->window()->IsActive()) |
| 1175 status = ash::STATUS_ACTIVE; | 1176 status = ash::STATUS_ACTIVE; |
| 1176 else | 1177 else |
| 1177 status = ash::STATUS_RUNNING; | 1178 status = ash::STATUS_RUNNING; |
| 1178 } | 1179 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( | 1212 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( |
| 1212 AppIconLoader* loader) { | 1213 AppIconLoader* loader) { |
| 1213 app_icon_loader_.reset(loader); | 1214 app_icon_loader_.reset(loader); |
| 1214 } | 1215 } |
| 1215 | 1216 |
| 1216 const std::string& | 1217 const std::string& |
| 1217 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( | 1218 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( |
| 1218 ash::LauncherID id) { | 1219 ash::LauncherID id) { |
| 1219 return id_to_item_controller_map_[id]->app_id(); | 1220 return id_to_item_controller_map_[id]->app_id(); |
| 1220 } | 1221 } |
| OLD | NEW |