Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc

Issue 11786003: Move Icons out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: License year update Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 int index) { 1154 int index) {
1154 ash::LauncherID id = model_->next_id(); 1155 ash::LauncherID id = model_->next_id();
1155 DCHECK(!HasItemController(id)); 1156 DCHECK(!HasItemController(id));
1156 DCHECK(controller); 1157 DCHECK(controller);
1157 id_to_item_controller_map_[id] = controller; 1158 id_to_item_controller_map_[id] = controller;
1158 controller->set_launcher_id(id); 1159 controller->set_launcher_id(id);
1159 1160
1160 ash::LauncherItem item; 1161 ash::LauncherItem item;
1161 item.type = controller->GetLauncherItemType(); 1162 item.type = controller->GetLauncherItemType();
1162 item.is_incognito = false; 1163 item.is_incognito = false;
1163 item.image = Extension::GetDefaultIcon(true); 1164 item.image = extensions::IconsInfo::GetDefaultIcon(true); // is app
1164 1165
1165 WebContents* active_tab = GetLastActiveWebContents(app_id); 1166 WebContents* active_tab = GetLastActiveWebContents(app_id);
1166 if (active_tab) { 1167 if (active_tab) {
1167 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); 1168 Browser* browser = chrome::FindBrowserWithWebContents(active_tab);
1168 DCHECK(browser); 1169 DCHECK(browser);
1169 if (browser->window()->IsActive()) 1170 if (browser->window()->IsActive())
1170 status = ash::STATUS_ACTIVE; 1171 status = ash::STATUS_ACTIVE;
1171 else 1172 else
1172 status = ash::STATUS_RUNNING; 1173 status = ash::STATUS_RUNNING;
1173 } 1174 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( 1207 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest(
1207 AppIconLoader* loader) { 1208 AppIconLoader* loader) {
1208 app_icon_loader_.reset(loader); 1209 app_icon_loader_.reset(loader);
1209 } 1210 }
1210 1211
1211 const std::string& 1212 const std::string&
1212 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( 1213 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest(
1213 ash::LauncherID id) { 1214 ash::LauncherID id) {
1214 return id_to_item_controller_map_[id]->app_id(); 1215 return id_to_item_controller_map_[id]->app_id();
1215 } 1216 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698