Chromium Code Reviews| Index: chrome/browser/extensions/chrome_app_sorting.cc |
| diff --git a/chrome/browser/extensions/chrome_app_sorting.cc b/chrome/browser/extensions/chrome_app_sorting.cc |
| index c96ae099db93950475ce0ab547884d7f130c53f0..391fac2c85237cd5b418a9625cf4c1afbdc39318 100644 |
| --- a/chrome/browser/extensions/chrome_app_sorting.cc |
| +++ b/chrome/browser/extensions/chrome_app_sorting.cc |
| @@ -9,9 +9,11 @@ |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/extensions/extension_sync_service.h" |
| +#include "chrome/browser/profiles/profile.h" |
| #include "chrome/common/extensions/extension_constants.h" |
| #include "content/public/browser/notification_service.h" |
| #include "extensions/browser/extension_scoped_prefs.h" |
| +#include "extensions/browser/extension_util.h" |
| #include "extensions/common/extension.h" |
| #if defined(OS_CHROMEOS) |
| @@ -47,7 +49,8 @@ ChromeAppSorting::AppOrdinals::~AppOrdinals() {} |
| // ChromeAppSorting |
| ChromeAppSorting::ChromeAppSorting() |
| - : extension_scoped_prefs_(NULL), |
| + : profile_(NULL), |
| + extension_scoped_prefs_(NULL), |
| extension_sync_service_(NULL), |
| default_ordinals_created_(false) { |
| } |
| @@ -62,6 +65,7 @@ void ChromeAppSorting::SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) { |
| void ChromeAppSorting::SetExtensionSyncService( |
| ExtensionSyncService* extension_sync_service) { |
| extension_sync_service_ = extension_sync_service; |
| + profile_ = extension_sync_service->profile(); |
| } |
| void ChromeAppSorting::Initialize( |
| @@ -226,6 +230,10 @@ void ChromeAppSorting::FixNTPOrdinalCollisions() { |
| void ChromeAppSorting::EnsureValidOrdinals( |
| const std::string& extension_id, |
| const syncer::StringOrdinal& suggested_page) { |
| + // Although installed transiently, ephemeral apps are not visible in the UI. |
| + if (profile_ && util::IsEphemeralApp(extension_id, profile_)) |
| + return; |
|
tapted
2014/07/16 05:03:38
It might not be safe to return early from here
"t
|
| + |
| syncer::StringOrdinal page_ordinal = GetPageOrdinal(extension_id); |
| if (!page_ordinal.IsValid()) { |
| if (suggested_page.IsValid()) { |