| 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 "base/command_line.h" | |
| 8 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
| 11 #include "chrome/browser/extensions/launch_util.h" | 10 #include "chrome/browser/extensions/launch_util.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/app_list/app_context_menu.h" | 12 #include "chrome/browser/ui/app_list/app_context_menu.h" |
| 14 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 13 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 15 #include "chrome/browser/ui/app_list/app_list_service.h" | 14 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 16 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 15 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
| 17 #include "chrome/browser/ui/host_desktop.h" | 16 #include "chrome/browser/ui/host_desktop.h" |
| 18 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" | 17 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" |
| 19 #include "chrome/common/chrome_switches.h" | |
| 20 #include "chrome/common/extensions/extension_constants.h" | 18 #include "chrome/common/extensions/extension_constants.h" |
| 21 #include "chrome/common/extensions/manifest_url_handler.h" | 19 #include "chrome/common/extensions/manifest_url_handler.h" |
| 22 #include "content/public/browser/user_metrics.h" | 20 #include "content/public/browser/user_metrics.h" |
| 23 #include "extensions/browser/app_sorting.h" | 21 #include "extensions/browser/app_sorting.h" |
| 24 #include "extensions/browser/extension_prefs.h" | 22 #include "extensions/browser/extension_prefs.h" |
| 25 #include "extensions/browser/extension_system.h" | 23 #include "extensions/browser/extension_system.h" |
| 26 #include "extensions/common/extension.h" | 24 #include "extensions/common/extension.h" |
| 27 #include "extensions/common/extension_icon_set.h" | 25 #include "extensions/common/extension_icon_set.h" |
| 28 #include "extensions/common/manifest_handlers/icons_handler.h" | 26 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 29 #include "grit/theme_resources.h" | 27 #include "grit/theme_resources.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 syncer::StringOrdinal()); | 139 syncer::StringOrdinal()); |
| 142 UpdatePositionFromExtensionOrdering(); | 140 UpdatePositionFromExtensionOrdering(); |
| 143 } | 141 } |
| 144 | 142 |
| 145 ExtensionAppItem::~ExtensionAppItem() { | 143 ExtensionAppItem::~ExtensionAppItem() { |
| 146 } | 144 } |
| 147 | 145 |
| 148 bool ExtensionAppItem::NeedsOverlay() const { | 146 bool ExtensionAppItem::NeedsOverlay() const { |
| 149 // The overlay icon is disabled for hosted apps in windowed mode with | 147 // The overlay icon is disabled for hosted apps in windowed mode with |
| 150 // streamlined hosted apps. | 148 // streamlined hosted apps. |
| 151 bool streamlined_hosted_apps = CommandLine::ForCurrentProcess()-> | 149 bool streamlined_hosted_apps = |
| 152 HasSwitch(switches::kEnableStreamlinedHostedApps); | 150 extensions::util::IsStreamlinedHostedAppsEnabled(); |
| 153 #if defined(OS_CHROMEOS) | 151 #if defined(OS_CHROMEOS) |
| 154 if (!streamlined_hosted_apps) | 152 if (!streamlined_hosted_apps) |
| 155 return false; | 153 return false; |
| 156 #endif | 154 #endif |
| 157 extensions::LaunchType launch_type = | 155 extensions::LaunchType launch_type = |
| 158 GetExtension() | 156 GetExtension() |
| 159 ? extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile_), | 157 ? extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile_), |
| 160 GetExtension()) | 158 GetExtension()) |
| 161 : extensions::LAUNCH_TYPE_WINDOW; | 159 : extensions::LAUNCH_TYPE_WINDOW; |
| 162 | 160 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 const syncer::StringOrdinal& launch = | 356 const syncer::StringOrdinal& launch = |
| 359 GetAppSorting(profile_)->GetAppLaunchOrdinal(extension_id_); | 357 GetAppSorting(profile_)->GetAppLaunchOrdinal(extension_id_); |
| 360 set_position(syncer::StringOrdinal( | 358 set_position(syncer::StringOrdinal( |
| 361 page.ToInternalValue() + launch.ToInternalValue())); | 359 page.ToInternalValue() + launch.ToInternalValue())); |
| 362 } | 360 } |
| 363 | 361 |
| 364 AppListControllerDelegate* ExtensionAppItem::GetController() { | 362 AppListControllerDelegate* ExtensionAppItem::GetController() { |
| 365 return AppListService::Get(chrome::GetActiveDesktop())-> | 363 return AppListService::Get(chrome::GetActiveDesktop())-> |
| 366 GetControllerDelegate(); | 364 GetControllerDelegate(); |
| 367 } | 365 } |
| OLD | NEW |