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

Side by Side Diff: chrome/browser/ui/app_list/extension_app_item.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/app_list/extension_app_item.h" 5 #include "chrome/browser/ui/app_list/extension_app_item.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/extensions/context_menu_matcher.h" 9 #include "chrome/browser/extensions/context_menu_matcher.h"
10 #include "chrome/browser/extensions/extension_prefs.h" 10 #include "chrome/browser/extensions/extension_prefs.h"
11 #include "chrome/browser/extensions/extension_service.h" 11 #include "chrome/browser/extensions/extension_service.h"
12 #include "chrome/browser/extensions/extension_sorting.h" 12 #include "chrome/browser/extensions/extension_sorting.h"
13 #include "chrome/browser/extensions/extension_system.h" 13 #include "chrome/browser/extensions/extension_system.h"
14 #include "chrome/browser/extensions/extension_uninstall_dialog.h" 14 #include "chrome/browser/extensions/extension_uninstall_dialog.h"
15 #include "chrome/browser/extensions/management_policy.h" 15 #include "chrome/browser/extensions/management_policy.h"
16 #include "chrome/browser/prefs/incognito_mode_prefs.h" 16 #include "chrome/browser/prefs/incognito_mode_prefs.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
19 #include "chrome/browser/ui/browser_navigator.h" 19 #include "chrome/browser/ui/browser_navigator.h"
20 #include "chrome/browser/ui/browser_tabstrip.h" 20 #include "chrome/browser/ui/browser_tabstrip.h"
21 #include "chrome/browser/ui/browser_window.h" 21 #include "chrome/browser/ui/browser_window.h"
22 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 22 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
23 #include "chrome/common/extensions/api/icons/icons_handler.h"
23 #include "chrome/common/extensions/extension.h" 24 #include "chrome/common/extensions/extension.h"
24 #include "chrome/common/extensions/extension_constants.h" 25 #include "chrome/common/extensions/extension_constants.h"
25 #include "chrome/common/extensions/extension_icon_set.h" 26 #include "chrome/common/extensions/extension_icon_set.h"
26 #include "chrome/common/extensions/manifest_url_handler.h" 27 #include "chrome/common/extensions/manifest_url_handler.h"
27 #include "content/public/common/context_menu_params.h" 28 #include "content/public/common/context_menu_params.h"
28 #include "grit/chromium_strings.h" 29 #include "grit/chromium_strings.h"
29 #include "grit/generated_resources.h" 30 #include "grit/generated_resources.h"
30 #include "grit/theme_resources.h" 31 #include "grit/theme_resources.h"
31 #include "ui/base/l10n/l10n_util.h" 32 #include "ui/base/l10n/l10n_util.h"
32 #include "ui/base/resource/resource_bundle.h" 33 #include "ui/base/resource/resource_bundle.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 305 }
305 306
306 void ExtensionAppItem::LoadImage(const Extension* extension) { 307 void ExtensionAppItem::LoadImage(const Extension* extension) {
307 int icon_size = extension_misc::EXTENSION_ICON_MEDIUM; 308 int icon_size = extension_misc::EXTENSION_ICON_MEDIUM;
308 if (HasOverlay()) 309 if (HasOverlay())
309 icon_size = extension_misc::EXTENSION_ICON_SMALL; 310 icon_size = extension_misc::EXTENSION_ICON_SMALL;
310 311
311 icon_.reset(new extensions::IconImage( 312 icon_.reset(new extensions::IconImage(
312 profile_, 313 profile_,
313 extension, 314 extension,
314 extension->icons(), 315 extensions::IconsInfo::GetIcons(extension),
315 icon_size, 316 icon_size,
316 Extension::GetDefaultIcon(true), 317 extensions::IconsInfo::GetDefaultAppIcon(),
317 this)); 318 this));
318 UpdateIcon(); 319 UpdateIcon();
319 } 320 }
320 321
321 void ExtensionAppItem::ShowExtensionOptions() { 322 void ExtensionAppItem::ShowExtensionOptions() {
322 const Extension* extension = GetExtension(); 323 const Extension* extension = GetExtension();
323 if (!extension) 324 if (!extension)
324 return; 325 return;
325 326
326 chrome::NavigateParams params( 327 chrome::NavigateParams params(
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 } 591 }
591 592
592 context_menu_model_->AddItemWithStringId(UNINSTALL, 593 context_menu_model_->AddItemWithStringId(UNINSTALL,
593 extension->is_platform_app() ? 594 extension->is_platform_app() ?
594 IDS_APP_LIST_UNINSTALL_ITEM : 595 IDS_APP_LIST_UNINSTALL_ITEM :
595 IDS_EXTENSIONS_UNINSTALL); 596 IDS_EXTENSIONS_UNINSTALL);
596 } 597 }
597 598
598 return context_menu_model_.get(); 599 return context_menu_model_.get();
599 } 600 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698