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

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: 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_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/launcher/launcher_util.h" 10 #include "ash/launcher/launcher_util.h"
(...skipping 28 matching lines...) Expand all
39 #include "chrome/browser/ui/browser_finder.h" 39 #include "chrome/browser/ui/browser_finder.h"
40 #include "chrome/browser/ui/browser_list.h" 40 #include "chrome/browser/ui/browser_list.h"
41 #include "chrome/browser/ui/browser_tabstrip.h" 41 #include "chrome/browser/ui/browser_tabstrip.h"
42 #include "chrome/browser/ui/browser_window.h" 42 #include "chrome/browser/ui/browser_window.h"
43 #include "chrome/browser/ui/extensions/application_launch.h" 43 #include "chrome/browser/ui/extensions/application_launch.h"
44 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 44 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
45 #include "chrome/browser/ui/tabs/tab_strip_model.h" 45 #include "chrome/browser/ui/tabs/tab_strip_model.h"
46 #include "chrome/browser/web_applications/web_app.h" 46 #include "chrome/browser/web_applications/web_app.h"
47 #include "chrome/common/chrome_notification_types.h" 47 #include "chrome/common/chrome_notification_types.h"
48 #include "chrome/common/chrome_switches.h" 48 #include "chrome/common/chrome_switches.h"
49 #include "chrome/common/extensions/api/icons/icons_handler.h"
49 #include "chrome/common/extensions/extension.h" 50 #include "chrome/common/extensions/extension.h"
50 #include "chrome/common/extensions/extension_resource.h" 51 #include "chrome/common/extensions/extension_resource.h"
51 #include "chrome/common/pref_names.h" 52 #include "chrome/common/pref_names.h"
52 #include "chrome/common/url_constants.h" 53 #include "chrome/common/url_constants.h"
53 #include "content/public/browser/navigation_entry.h" 54 #include "content/public/browser/navigation_entry.h"
54 #include "content/public/browser/notification_service.h" 55 #include "content/public/browser/notification_service.h"
55 #include "content/public/browser/web_contents.h" 56 #include "content/public/browser/web_contents.h"
56 #include "extensions/common/url_pattern.h" 57 #include "extensions/common/url_pattern.h"
57 #include "grit/ash_resources.h" 58 #include "grit/ash_resources.h"
58 #include "grit/chromium_strings.h" 59 #include "grit/chromium_strings.h"
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 int index) { 1276 int index) {
1276 ash::LauncherID id = model_->next_id(); 1277 ash::LauncherID id = model_->next_id();
1277 DCHECK(!HasItemController(id)); 1278 DCHECK(!HasItemController(id));
1278 DCHECK(controller); 1279 DCHECK(controller);
1279 id_to_item_controller_map_[id] = controller; 1280 id_to_item_controller_map_[id] = controller;
1280 controller->set_launcher_id(id); 1281 controller->set_launcher_id(id);
1281 1282
1282 ash::LauncherItem item; 1283 ash::LauncherItem item;
1283 item.type = controller->GetLauncherItemType(); 1284 item.type = controller->GetLauncherItemType();
1284 item.is_incognito = false; 1285 item.is_incognito = false;
1285 item.image = Extension::GetDefaultIcon(true); 1286 item.image = extensions::IconsInfo::GetDefaultAppIcon();
1286 1287
1287 WebContents* active_tab = GetLastActiveWebContents(app_id); 1288 WebContents* active_tab = GetLastActiveWebContents(app_id);
1288 if (active_tab) { 1289 if (active_tab) {
1289 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); 1290 Browser* browser = chrome::FindBrowserWithWebContents(active_tab);
1290 DCHECK(browser); 1291 DCHECK(browser);
1291 if (browser->window()->IsActive()) 1292 if (browser->window()->IsActive())
1292 status = ash::STATUS_ACTIVE; 1293 status = ash::STATUS_ACTIVE;
1293 else 1294 else
1294 status = ash::STATUS_RUNNING; 1295 status = ash::STATUS_RUNNING;
1295 } 1296 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 WebContents* web_contents = 1335 WebContents* web_contents =
1335 tab_strip->GetWebContentsAt(tab_strip->active_index()); 1336 tab_strip->GetWebContentsAt(tab_strip->active_index());
1336 gfx::Image app_icon = GetAppListIcon(web_contents); 1337 gfx::Image app_icon = GetAppListIcon(web_contents);
1337 items->push_back(new ChromeLauncherAppMenuItemBrowser( 1338 items->push_back(new ChromeLauncherAppMenuItemBrowser(
1338 web_contents->GetTitle(), 1339 web_contents->GetTitle(),
1339 app_icon.IsEmpty() ? NULL : &app_icon, 1340 app_icon.IsEmpty() ? NULL : &app_icon,
1340 browser)); 1341 browser));
1341 } 1342 }
1342 return items; 1343 return items;
1343 } 1344 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698