| OLD | NEW |
| 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 "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_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/extensions/extension_sorting.h" | 11 #include "chrome/browser/extensions/extension_sorting.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" | 12 #include "chrome/browser/extensions/extension_system.h" |
| 13 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 13 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 14 #include "chrome/browser/extensions/management_policy.h" | 14 #include "chrome/browser/extensions/management_policy.h" |
| 15 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 15 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 return extension; | 285 return extension; |
| 285 } | 286 } |
| 286 | 287 |
| 287 void ExtensionAppItem::LoadImage(const Extension* extension) { | 288 void ExtensionAppItem::LoadImage(const Extension* extension) { |
| 288 int icon_size = extension_misc::EXTENSION_ICON_MEDIUM; | 289 int icon_size = extension_misc::EXTENSION_ICON_MEDIUM; |
| 289 if (has_overlay_) | 290 if (has_overlay_) |
| 290 icon_size = extension_misc::EXTENSION_ICON_SMALL; | 291 icon_size = extension_misc::EXTENSION_ICON_SMALL; |
| 291 | 292 |
| 292 icon_.reset(new extensions::IconImage( | 293 icon_.reset(new extensions::IconImage( |
| 293 extension, | 294 extension, |
| 294 extension->icons(), | 295 extensions::IconsInfo::GetIcons(extension), |
| 295 icon_size, | 296 icon_size, |
| 296 Extension::GetDefaultIcon(true), | 297 extensions::IconsInfo::GetDefaultAppIcon(), |
| 297 this)); | 298 this)); |
| 298 UpdateIcon(); | 299 UpdateIcon(); |
| 299 } | 300 } |
| 300 | 301 |
| 301 void ExtensionAppItem::ShowExtensionOptions() { | 302 void ExtensionAppItem::ShowExtensionOptions() { |
| 302 const Extension* extension = GetExtension(); | 303 const Extension* extension = GetExtension(); |
| 303 if (!extension) | 304 if (!extension) |
| 304 return; | 305 return; |
| 305 | 306 |
| 306 chrome::NavigateParams params( | 307 chrome::NavigateParams params( |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 } | 576 } |
| 576 | 577 |
| 577 context_menu_model_->AddItemWithStringId(UNINSTALL, | 578 context_menu_model_->AddItemWithStringId(UNINSTALL, |
| 578 extension->is_platform_app() ? | 579 extension->is_platform_app() ? |
| 579 IDS_APP_LIST_UNINSTALL_ITEM : | 580 IDS_APP_LIST_UNINSTALL_ITEM : |
| 580 IDS_EXTENSIONS_UNINSTALL); | 581 IDS_EXTENSIONS_UNINSTALL); |
| 581 } | 582 } |
| 582 | 583 |
| 583 return context_menu_model_.get(); | 584 return context_menu_model_.get(); |
| 584 } | 585 } |
| OLD | NEW |