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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.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_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
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/chromium_strings.h" 55 #include "grit/chromium_strings.h"
55 #include "grit/generated_resources.h" 56 #include "grit/generated_resources.h"
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 int index) { 1175 int index) {
1175 ash::LauncherID id = model_->next_id(); 1176 ash::LauncherID id = model_->next_id();
1176 DCHECK(!HasItemController(id)); 1177 DCHECK(!HasItemController(id));
1177 DCHECK(controller); 1178 DCHECK(controller);
1178 id_to_item_controller_map_[id] = controller; 1179 id_to_item_controller_map_[id] = controller;
1179 controller->set_launcher_id(id); 1180 controller->set_launcher_id(id);
1180 1181
1181 ash::LauncherItem item; 1182 ash::LauncherItem item;
1182 item.type = controller->GetLauncherItemType(); 1183 item.type = controller->GetLauncherItemType();
1183 item.is_incognito = false; 1184 item.is_incognito = false;
1184 item.image = Extension::GetDefaultIcon(true); 1185 item.image = extensions::IconsInfo::GetDefaultIcon(true); // is app
1185 1186
1186 WebContents* active_tab = GetLastActiveWebContents(app_id); 1187 WebContents* active_tab = GetLastActiveWebContents(app_id);
1187 if (active_tab) { 1188 if (active_tab) {
1188 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); 1189 Browser* browser = chrome::FindBrowserWithWebContents(active_tab);
1189 DCHECK(browser); 1190 DCHECK(browser);
1190 if (browser->window()->IsActive()) 1191 if (browser->window()->IsActive())
1191 status = ash::STATUS_ACTIVE; 1192 status = ash::STATUS_ACTIVE;
1192 else 1193 else
1193 status = ash::STATUS_RUNNING; 1194 status = ash::STATUS_RUNNING;
1194 } 1195 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 FaviconTabHelper* favicon_tab_helper = 1235 FaviconTabHelper* favicon_tab_helper =
1235 FaviconTabHelper::FromWebContents(web_contents); 1236 FaviconTabHelper::FromWebContents(web_contents);
1236 gfx::Image app_icon = favicon_tab_helper->GetFavicon(); 1237 gfx::Image app_icon = favicon_tab_helper->GetFavicon();
1237 items->push_back(new ChromeLauncherAppMenuItemBrowser( 1238 items->push_back(new ChromeLauncherAppMenuItemBrowser(
1238 web_contents->GetTitle(), 1239 web_contents->GetTitle(),
1239 app_icon.IsEmpty() ? NULL : &app_icon, 1240 app_icon.IsEmpty() ? NULL : &app_icon,
1240 browser)); 1241 browser));
1241 } 1242 }
1242 return items; 1243 return items;
1243 } 1244 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698