Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
|
sky
2013/01/17 00:47:11
New year, new rules. Don't update copyrights anymo
| |
| 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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/extensions/context_menu_matcher.h" | 8 #include "chrome/browser/extensions/context_menu_matcher.h" |
| 9 #include "chrome/browser/extensions/extension_install_prompt.h" | 9 #include "chrome/browser/extensions/extension_install_prompt.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/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 19 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
| 21 #include "chrome/browser/ui/browser_finder.h" | 21 #include "chrome/browser/ui/browser_finder.h" |
| 22 #include "chrome/browser/ui/browser_navigator.h" | 22 #include "chrome/browser/ui/browser_navigator.h" |
| 23 #include "chrome/browser/ui/browser_tabstrip.h" | 23 #include "chrome/browser/ui/browser_tabstrip.h" |
| 24 #include "chrome/browser/ui/browser_window.h" | 24 #include "chrome/browser/ui/browser_window.h" |
| 25 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 25 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
| 26 #include "chrome/common/extensions/api/icons/icons_handler.h" | |
| 26 #include "chrome/common/extensions/extension.h" | 27 #include "chrome/common/extensions/extension.h" |
| 27 #include "chrome/common/extensions/extension_constants.h" | 28 #include "chrome/common/extensions/extension_constants.h" |
| 28 #include "chrome/common/extensions/extension_icon_set.h" | 29 #include "chrome/common/extensions/extension_icon_set.h" |
| 29 #include "chrome/common/extensions/manifest_url_handler.h" | 30 #include "chrome/common/extensions/manifest_url_handler.h" |
| 30 #include "content/public/common/context_menu_params.h" | 31 #include "content/public/common/context_menu_params.h" |
| 31 #include "grit/chromium_strings.h" | 32 #include "grit/chromium_strings.h" |
| 32 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
| 33 #include "grit/theme_resources.h" | 34 #include "grit/theme_resources.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
| 35 #include "ui/base/resource/resource_bundle.h" | 36 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 return extension; | 287 return extension; |
| 287 } | 288 } |
| 288 | 289 |
| 289 void ExtensionAppItem::LoadImage(const Extension* extension) { | 290 void ExtensionAppItem::LoadImage(const Extension* extension) { |
| 290 int icon_size = extension_misc::EXTENSION_ICON_MEDIUM; | 291 int icon_size = extension_misc::EXTENSION_ICON_MEDIUM; |
| 291 if (has_overlay_) | 292 if (has_overlay_) |
| 292 icon_size = extension_misc::EXTENSION_ICON_SMALL; | 293 icon_size = extension_misc::EXTENSION_ICON_SMALL; |
| 293 | 294 |
| 294 icon_.reset(new extensions::IconImage( | 295 icon_.reset(new extensions::IconImage( |
| 295 extension, | 296 extension, |
| 296 extension->icons(), | 297 IconsInfo::GetIcons(extension), |
| 297 icon_size, | 298 icon_size, |
| 298 Extension::GetDefaultIcon(true), | 299 IconsInfo::GetDefaultAppIcon(), |
| 299 this)); | 300 this)); |
| 300 UpdateIcon(); | 301 UpdateIcon(); |
| 301 } | 302 } |
| 302 | 303 |
| 303 void ExtensionAppItem::ShowExtensionOptions() { | 304 void ExtensionAppItem::ShowExtensionOptions() { |
| 304 const Extension* extension = GetExtension(); | 305 const Extension* extension = GetExtension(); |
| 305 if (!extension) | 306 if (!extension) |
| 306 return; | 307 return; |
| 307 | 308 |
| 308 chrome::NavigateParams params( | 309 chrome::NavigateParams params( |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 583 } | 584 } |
| 584 | 585 |
| 585 context_menu_model_->AddItemWithStringId(UNINSTALL, | 586 context_menu_model_->AddItemWithStringId(UNINSTALL, |
| 586 extension->is_platform_app() ? | 587 extension->is_platform_app() ? |
| 587 IDS_APP_LIST_UNINSTALL_ITEM : | 588 IDS_APP_LIST_UNINSTALL_ITEM : |
| 588 IDS_EXTENSIONS_UNINSTALL); | 589 IDS_EXTENSIONS_UNINSTALL); |
| 589 } | 590 } |
| 590 | 591 |
| 591 return context_menu_model_.get(); | 592 return context_menu_model_.get(); |
| 592 } | 593 } |
| OLD | NEW |