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

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, 9 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 30 matching lines...) Expand all
41 #include "chrome/browser/ui/browser_list.h" 41 #include "chrome/browser/ui/browser_list.h"
42 #include "chrome/browser/ui/browser_tabstrip.h" 42 #include "chrome/browser/ui/browser_tabstrip.h"
43 #include "chrome/browser/ui/browser_window.h" 43 #include "chrome/browser/ui/browser_window.h"
44 #include "chrome/browser/ui/extensions/application_launch.h" 44 #include "chrome/browser/ui/extensions/application_launch.h"
45 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 45 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
46 #include "chrome/browser/ui/host_desktop.h" 46 #include "chrome/browser/ui/host_desktop.h"
47 #include "chrome/browser/ui/tabs/tab_strip_model.h" 47 #include "chrome/browser/ui/tabs/tab_strip_model.h"
48 #include "chrome/browser/web_applications/web_app.h" 48 #include "chrome/browser/web_applications/web_app.h"
49 #include "chrome/common/chrome_notification_types.h" 49 #include "chrome/common/chrome_notification_types.h"
50 #include "chrome/common/chrome_switches.h" 50 #include "chrome/common/chrome_switches.h"
51 #include "chrome/common/extensions/api/icons/icons_handler.h"
51 #include "chrome/common/extensions/extension.h" 52 #include "chrome/common/extensions/extension.h"
52 #include "chrome/common/extensions/extension_resource.h" 53 #include "chrome/common/extensions/extension_resource.h"
53 #include "chrome/common/pref_names.h" 54 #include "chrome/common/pref_names.h"
54 #include "chrome/common/url_constants.h" 55 #include "chrome/common/url_constants.h"
55 #include "content/public/browser/navigation_entry.h" 56 #include "content/public/browser/navigation_entry.h"
56 #include "content/public/browser/notification_service.h" 57 #include "content/public/browser/notification_service.h"
57 #include "content/public/browser/web_contents.h" 58 #include "content/public/browser/web_contents.h"
58 #include "extensions/common/url_pattern.h" 59 #include "extensions/common/url_pattern.h"
59 #include "grit/ash_resources.h" 60 #include "grit/ash_resources.h"
60 #include "grit/chromium_strings.h" 61 #include "grit/chromium_strings.h"
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 ash::LauncherItemType launcher_item_type) { 1384 ash::LauncherItemType launcher_item_type) {
1384 ash::LauncherID id = model_->next_id(); 1385 ash::LauncherID id = model_->next_id();
1385 DCHECK(!HasItemController(id)); 1386 DCHECK(!HasItemController(id));
1386 DCHECK(controller); 1387 DCHECK(controller);
1387 id_to_item_controller_map_[id] = controller; 1388 id_to_item_controller_map_[id] = controller;
1388 controller->set_launcher_id(id); 1389 controller->set_launcher_id(id);
1389 1390
1390 ash::LauncherItem item; 1391 ash::LauncherItem item;
1391 item.type = launcher_item_type; 1392 item.type = launcher_item_type;
1392 item.is_incognito = false; 1393 item.is_incognito = false;
1393 item.image = Extension::GetDefaultIcon(true); 1394 item.image = extensions::IconsInfo::GetDefaultAppIcon();
1394 1395
1395 WebContents* active_tab = GetLastActiveWebContents(app_id); 1396 WebContents* active_tab = GetLastActiveWebContents(app_id);
1396 if (active_tab) { 1397 if (active_tab) {
1397 Browser* browser = chrome::FindBrowserWithWebContents(active_tab); 1398 Browser* browser = chrome::FindBrowserWithWebContents(active_tab);
1398 DCHECK(browser); 1399 DCHECK(browser);
1399 if (browser->window()->IsActive()) 1400 if (browser->window()->IsActive())
1400 status = ash::STATUS_ACTIVE; 1401 status = ash::STATUS_ACTIVE;
1401 else 1402 else
1402 status = ash::STATUS_RUNNING; 1403 status = ash::STATUS_RUNNING;
1403 } 1404 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 web_contents->GetTitle(), 1457 web_contents->GetTitle(),
1457 app_icon.IsEmpty() ? NULL : &app_icon, 1458 app_icon.IsEmpty() ? NULL : &app_icon,
1458 browser)); 1459 browser));
1459 } 1460 }
1460 // If only windowed applications are open, we return an empty list to 1461 // If only windowed applications are open, we return an empty list to
1461 // enforce the creation of a new browser. 1462 // enforce the creation of a new browser.
1462 if (!found_tabbed_browser) 1463 if (!found_tabbed_browser)
1463 items.clear(); 1464 items.clear();
1464 return items.Pass(); 1465 return items.Pass();
1465 } 1466 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698