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

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: Created 7 years, 10 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) 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 21 matching lines...) Expand all
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/extensions/application_launch.h" 36 #include "chrome/browser/ui/extensions/application_launch.h"
37 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 37 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
38 #include "chrome/browser/ui/tabs/tab_strip_model.h" 38 #include "chrome/browser/ui/tabs/tab_strip_model.h"
39 #include "chrome/browser/web_applications/web_app.h" 39 #include "chrome/browser/web_applications/web_app.h"
40 #include "chrome/common/chrome_notification_types.h" 40 #include "chrome/common/chrome_notification_types.h"
41 #include "chrome/common/chrome_switches.h" 41 #include "chrome/common/chrome_switches.h"
42 #include "chrome/common/extensions/api/icons/icons_handler.h"
42 #include "chrome/common/extensions/extension.h" 43 #include "chrome/common/extensions/extension.h"
43 #include "chrome/common/extensions/extension_resource.h" 44 #include "chrome/common/extensions/extension_resource.h"
44 #include "chrome/common/pref_names.h" 45 #include "chrome/common/pref_names.h"
45 #include "chrome/common/url_constants.h" 46 #include "chrome/common/url_constants.h"
46 #include "content/public/browser/navigation_entry.h" 47 #include "content/public/browser/navigation_entry.h"
47 #include "content/public/browser/notification_service.h" 48 #include "content/public/browser/notification_service.h"
48 #include "content/public/browser/web_contents.h" 49 #include "content/public/browser/web_contents.h"
49 #include "extensions/common/url_pattern.h" 50 #include "extensions/common/url_pattern.h"
50 #include "grit/theme_resources.h" 51 #include "grit/theme_resources.h"
51 #include "ui/aura/root_window.h" 52 #include "ui/aura/root_window.h"
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 int index) { 1205 int index) {
1205 ash::LauncherID id = model_->next_id(); 1206 ash::LauncherID id = model_->next_id();
1206 DCHECK(!HasItemController(id)); 1207 DCHECK(!HasItemController(id));
1207 DCHECK(controller); 1208 DCHECK(controller);
1208 id_to_item_controller_map_[id] = controller; 1209 id_to_item_controller_map_[id] = controller;
1209 controller->set_launcher_id(id); 1210 controller->set_launcher_id(id);
1210 1211
1211 ash::LauncherItem item; 1212 ash::LauncherItem item;
1212 item.type = controller->GetLauncherItemType(); 1213 item.type = controller->GetLauncherItemType();
1213 item.is_incognito = false; 1214 item.is_incognito = false;
1214 item.image = Extension::GetDefaultIcon(true); 1215 item.image = extensions::IconsInfo::GetDefaultAppIcon();
1215 1216
1216 WebContents* active_tab = GetLastActiveWebContents(app_id); 1217 WebContents* active_tab = GetLastActiveWebContents(app_id);
1217 if (active_tab) { 1218 if (active_tab) {
1218 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); 1219 Browser* browser = chrome::FindBrowserWithWebContents(active_tab);
1219 DCHECK(browser); 1220 DCHECK(browser);
1220 if (browser->window()->IsActive()) 1221 if (browser->window()->IsActive())
1221 status = ash::STATUS_ACTIVE; 1222 status = ash::STATUS_ACTIVE;
1222 else 1223 else
1223 status = ash::STATUS_RUNNING; 1224 status = ash::STATUS_RUNNING;
1224 } 1225 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( 1258 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest(
1258 ash::AppIconLoader* loader) { 1259 ash::AppIconLoader* loader) {
1259 app_icon_loader_.reset(loader); 1260 app_icon_loader_.reset(loader);
1260 } 1261 }
1261 1262
1262 const std::string& 1263 const std::string&
1263 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( 1264 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest(
1264 ash::LauncherID id) { 1265 ash::LauncherID id) {
1265 return id_to_item_controller_map_[id]->app_id(); 1266 return id_to_item_controller_map_[id]->app_id();
1266 } 1267 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698