| 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_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" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/ui/browser_finder.h" | 34 #include "chrome/browser/ui/browser_finder.h" |
| 35 #include "chrome/browser/ui/browser_tabstrip.h" | 35 #include "chrome/browser/ui/browser_tabstrip.h" |
| 36 #include "chrome/browser/ui/browser_window.h" | 36 #include "chrome/browser/ui/browser_window.h" |
| 37 #include "chrome/browser/ui/extensions/application_launch.h" | 37 #include "chrome/browser/ui/extensions/application_launch.h" |
| 38 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 38 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
| 39 #include "chrome/browser/ui/host_desktop.h" | 39 #include "chrome/browser/ui/host_desktop.h" |
| 40 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 40 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 41 #include "chrome/browser/web_applications/web_app.h" | 41 #include "chrome/browser/web_applications/web_app.h" |
| 42 #include "chrome/common/chrome_notification_types.h" | 42 #include "chrome/common/chrome_notification_types.h" |
| 43 #include "chrome/common/chrome_switches.h" | 43 #include "chrome/common/chrome_switches.h" |
| 44 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 44 #include "chrome/common/extensions/extension.h" | 45 #include "chrome/common/extensions/extension.h" |
| 45 #include "chrome/common/extensions/extension_resource.h" | 46 #include "chrome/common/extensions/extension_resource.h" |
| 46 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
| 47 #include "chrome/common/url_constants.h" | 48 #include "chrome/common/url_constants.h" |
| 48 #include "content/public/browser/navigation_entry.h" | 49 #include "content/public/browser/navigation_entry.h" |
| 49 #include "content/public/browser/notification_service.h" | 50 #include "content/public/browser/notification_service.h" |
| 50 #include "content/public/browser/web_contents.h" | 51 #include "content/public/browser/web_contents.h" |
| 51 #include "extensions/common/url_pattern.h" | 52 #include "extensions/common/url_pattern.h" |
| 52 #include "grit/theme_resources.h" | 53 #include "grit/theme_resources.h" |
| 53 #include "ui/aura/root_window.h" | 54 #include "ui/aura/root_window.h" |
| (...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 int index) { | 1259 int index) { |
| 1259 ash::LauncherID id = model_->next_id(); | 1260 ash::LauncherID id = model_->next_id(); |
| 1260 DCHECK(!HasItemController(id)); | 1261 DCHECK(!HasItemController(id)); |
| 1261 DCHECK(controller); | 1262 DCHECK(controller); |
| 1262 id_to_item_controller_map_[id] = controller; | 1263 id_to_item_controller_map_[id] = controller; |
| 1263 controller->set_launcher_id(id); | 1264 controller->set_launcher_id(id); |
| 1264 | 1265 |
| 1265 ash::LauncherItem item; | 1266 ash::LauncherItem item; |
| 1266 item.type = controller->GetLauncherItemType(); | 1267 item.type = controller->GetLauncherItemType(); |
| 1267 item.is_incognito = false; | 1268 item.is_incognito = false; |
| 1268 item.image = Extension::GetDefaultIcon(true); | 1269 item.image = extensions::IconsInfo::GetDefaultAppIcon(); |
| 1269 | 1270 |
| 1270 WebContents* active_tab = GetLastActiveWebContents(app_id); | 1271 WebContents* active_tab = GetLastActiveWebContents(app_id); |
| 1271 if (active_tab) { | 1272 if (active_tab) { |
| 1272 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); | 1273 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); |
| 1273 DCHECK(browser); | 1274 DCHECK(browser); |
| 1274 if (browser->window()->IsActive()) | 1275 if (browser->window()->IsActive()) |
| 1275 status = ash::STATUS_ACTIVE; | 1276 status = ash::STATUS_ACTIVE; |
| 1276 else | 1277 else |
| 1277 status = ash::STATUS_RUNNING; | 1278 status = ash::STATUS_RUNNING; |
| 1278 } | 1279 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( | 1312 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( |
| 1312 extensions::AppIconLoader* loader) { | 1313 extensions::AppIconLoader* loader) { |
| 1313 app_icon_loader_.reset(loader); | 1314 app_icon_loader_.reset(loader); |
| 1314 } | 1315 } |
| 1315 | 1316 |
| 1316 const std::string& | 1317 const std::string& |
| 1317 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( | 1318 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( |
| 1318 ash::LauncherID id) { | 1319 ash::LauncherID id) { |
| 1319 return id_to_item_controller_map_[id]->app_id(); | 1320 return id_to_item_controller_map_[id]->app_id(); |
| 1320 } | 1321 } |
| OLD | NEW |