Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6210)

Unified Diff: chrome/browser/extensions/chrome_app_sorting.cc

Issue 397903002: Do not assign launch ordinals to ephemeral apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ephemapp_unload_review
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/chrome_app_sorting.h ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « chrome/browser/extensions/chrome_app_sorting.h ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698