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

Side by Side Diff: chrome/browser/ui/ash/app_list/extension_app_item.cc

Issue 10843014: Generalize ExtensionIconSet to store icon paths for custom size sets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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 | Annotate | Revision Log
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/app_list/extension_app_item.h" 5 #include "chrome/browser/ui/ash/app_list/extension_app_item.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_prefs.h" 8 #include "chrome/browser/extensions/extension_prefs.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_system.h" 10 #include "chrome/browser/extensions/extension_system.h"
11 #include "chrome/browser/extensions/extension_uninstall_dialog.h" 11 #include "chrome/browser/extensions/extension_uninstall_dialog.h"
12 #include "chrome/browser/extensions/management_policy.h" 12 #include "chrome/browser/extensions/management_policy.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/ash/extension_utils.h" 14 #include "chrome/browser/ui/ash/extension_utils.h"
15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
16 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/browser_finder.h" 17 #include "chrome/browser/ui/browser_finder.h"
18 #include "chrome/browser/ui/browser_tabstrip.h" 18 #include "chrome/browser/ui/browser_tabstrip.h"
19 #include "chrome/browser/ui/browser_window.h" 19 #include "chrome/browser/ui/browser_window.h"
20 #include "chrome/common/extensions/extension.h" 20 #include "chrome/common/extensions/extension.h"
21 #include "chrome/common/extensions/extension_constants.h"
21 #include "chrome/common/extensions/extension_icon_set.h" 22 #include "chrome/common/extensions/extension_icon_set.h"
22 #include "grit/chromium_strings.h" 23 #include "grit/chromium_strings.h"
23 #include "grit/generated_resources.h" 24 #include "grit/generated_resources.h"
24 #include "ui/base/l10n/l10n_util.h" 25 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/gfx/image/image.h" 26 #include "ui/gfx/image/image.h"
26 27
27 using extensions::Extension; 28 using extensions::Extension;
28 29
29 namespace { 30 namespace {
30 31
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 const Extension* ExtensionAppItem::GetExtension() const { 149 const Extension* ExtensionAppItem::GetExtension() const {
149 const Extension* extension = 150 const Extension* extension =
150 profile_->GetExtensionService()->GetInstalledExtension(extension_id_); 151 profile_->GetExtensionService()->GetInstalledExtension(extension_id_);
151 return extension; 152 return extension;
152 } 153 }
153 154
154 void ExtensionAppItem::LoadImage(const Extension* extension) { 155 void ExtensionAppItem::LoadImage(const Extension* extension) {
155 tracker_.reset(new ImageLoadingTracker(this)); 156 tracker_.reset(new ImageLoadingTracker(this));
156 tracker_->LoadImage(extension, 157 tracker_->LoadImage(extension,
157 extension->GetIconResource( 158 extension->GetIconResource(
158 ExtensionIconSet::EXTENSION_ICON_LARGE, 159 extension_misc::EXTENSION_ICON_LARGE,
159 ExtensionIconSet::MATCH_BIGGER), 160 ExtensionIconSet::MATCH_BIGGER),
160 gfx::Size(ExtensionIconSet::EXTENSION_ICON_LARGE, 161 gfx::Size(extension_misc::EXTENSION_ICON_LARGE,
161 ExtensionIconSet::EXTENSION_ICON_LARGE), 162 extension_misc::EXTENSION_ICON_LARGE),
162 ImageLoadingTracker::DONT_CACHE); 163 ImageLoadingTracker::DONT_CACHE);
163 } 164 }
164 165
165 void ExtensionAppItem::ShowExtensionOptions() { 166 void ExtensionAppItem::ShowExtensionOptions() {
166 const Extension* extension = GetExtension(); 167 const Extension* extension = GetExtension();
167 if (!extension) 168 if (!extension)
168 return; 169 return;
169 170
170 // TODO(beng): use Navigate()! 171 // TODO(beng): use Navigate()!
171 Browser* browser = browser::FindLastActiveWithProfile(profile_); 172 Browser* browser = browser::FindLastActiveWithProfile(profile_);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 LAUNCH_TYPE_FULLSCREEN, 300 LAUNCH_TYPE_FULLSCREEN,
300 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); 301 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED);
301 context_menu_model_->AddSeparator(); 302 context_menu_model_->AddSeparator();
302 context_menu_model_->AddItemWithStringId(OPTIONS, IDS_NEW_TAB_APP_OPTIONS); 303 context_menu_model_->AddItemWithStringId(OPTIONS, IDS_NEW_TAB_APP_OPTIONS);
303 context_menu_model_->AddItemWithStringId(UNINSTALL, 304 context_menu_model_->AddItemWithStringId(UNINSTALL,
304 IDS_EXTENSIONS_UNINSTALL); 305 IDS_EXTENSIONS_UNINSTALL);
305 } 306 }
306 307
307 return context_menu_model_.get(); 308 return context_menu_model_.get();
308 } 309 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/browser/ui/ash/app_list/search_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698