| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
| 10 #include "chrome/browser/extensions/launch_util.h" | 10 #include "chrome/browser/extensions/launch_util.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 GetAppSorting(profile_)->EnsureValidOrdinals(extension_id_, | 139 GetAppSorting(profile_)->EnsureValidOrdinals(extension_id_, |
| 140 syncer::StringOrdinal()); | 140 syncer::StringOrdinal()); |
| 141 UpdatePositionFromExtensionOrdering(); | 141 UpdatePositionFromExtensionOrdering(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 ExtensionAppItem::~ExtensionAppItem() { | 144 ExtensionAppItem::~ExtensionAppItem() { |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool ExtensionAppItem::NeedsOverlay() const { | 147 bool ExtensionAppItem::NeedsOverlay() const { |
| 148 // The overlay icon is disabled for hosted apps in windowed mode with | |
| 149 // streamlined hosted apps. | |
| 150 bool streamlined_hosted_apps = | |
| 151 extensions::util::IsStreamlinedHostedAppsEnabled(); | |
| 152 #if defined(OS_CHROMEOS) | 148 #if defined(OS_CHROMEOS) |
| 153 if (!streamlined_hosted_apps) | 149 // The overlay is disabled completely in ChromeOS. |
| 154 return false; | 150 return false; |
| 155 #endif | 151 #endif |
| 152 |
| 156 extensions::LaunchType launch_type = | 153 extensions::LaunchType launch_type = |
| 157 GetExtension() | 154 GetExtension() |
| 158 ? extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile_), | 155 ? extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile_), |
| 159 GetExtension()) | 156 GetExtension()) |
| 160 : extensions::LAUNCH_TYPE_WINDOW; | 157 : extensions::LAUNCH_TYPE_WINDOW; |
| 161 | 158 |
| 159 // The overlay icon is disabled for hosted apps in windowed mode with |
| 160 // streamlined hosted apps. |
| 162 return !is_platform_app_ && extension_id_ != extension_misc::kChromeAppId && | 161 return !is_platform_app_ && extension_id_ != extension_misc::kChromeAppId && |
| 163 (!streamlined_hosted_apps || | 162 (!extensions::util::IsStreamlinedHostedAppsEnabled() || |
| 164 launch_type != extensions::LAUNCH_TYPE_WINDOW); | 163 launch_type != extensions::LAUNCH_TYPE_WINDOW); |
| 165 } | 164 } |
| 166 | 165 |
| 167 void ExtensionAppItem::Reload() { | 166 void ExtensionAppItem::Reload() { |
| 168 const Extension* extension = GetExtension(); | 167 const Extension* extension = GetExtension(); |
| 169 bool is_installing = !extension; | 168 bool is_installing = !extension; |
| 170 SetIsInstalling(is_installing); | 169 SetIsInstalling(is_installing); |
| 171 if (is_installing) { | 170 if (is_installing) { |
| 172 SetName(extension_name_); | 171 SetName(extension_name_); |
| 173 UpdateIcon(); | 172 UpdateIcon(); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 const syncer::StringOrdinal& launch = | 354 const syncer::StringOrdinal& launch = |
| 356 GetAppSorting(profile_)->GetAppLaunchOrdinal(extension_id_); | 355 GetAppSorting(profile_)->GetAppLaunchOrdinal(extension_id_); |
| 357 set_position(syncer::StringOrdinal( | 356 set_position(syncer::StringOrdinal( |
| 358 page.ToInternalValue() + launch.ToInternalValue())); | 357 page.ToInternalValue() + launch.ToInternalValue())); |
| 359 } | 358 } |
| 360 | 359 |
| 361 AppListControllerDelegate* ExtensionAppItem::GetController() { | 360 AppListControllerDelegate* ExtensionAppItem::GetController() { |
| 362 return AppListService::Get(chrome::GetActiveDesktop())-> | 361 return AppListService::Get(chrome::GetActiveDesktop())-> |
| 363 GetControllerDelegate(); | 362 GetControllerDelegate(); |
| 364 } | 363 } |
| OLD | NEW |