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

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

Issue 282103003: Moved IS_EPHEMERAL flag to extension prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor refactoring. Added comments. Created 6 years, 7 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
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 037abdbbdbe63e221bd4e4d1888fafcbb310cb18..25a358ef5e1b1e506aef6d033db9a588927ce9a4 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -575,8 +575,8 @@ bool ExtensionService::UpdateExtension(const std::string& id,
if (extension && extension->was_installed_by_oem())
creation_flags |= Extension::WAS_INSTALLED_BY_OEM;
- if (extension && extension->is_ephemeral())
- creation_flags |= Extension::IS_EPHEMERAL;
+ if (extension)
+ installer->set_is_ephemeral(extension_prefs_->IsEphemeralApp(id));
installer->set_creation_flags(creation_flags);
@@ -733,7 +733,7 @@ bool ExtensionService::UninstallExtension(const std::string& extension_id,
// Do not remove the data of ephemeral apps. They will be garbage collected by
// EphemeralAppService.
- if (!extension->is_ephemeral())
+ if (!extension_prefs_->IsEphemeralApp(extension_id))
extensions::DataDeleter::StartDeleting(profile_, extension.get());
UntrackTerminatedExtension(extension_id);
@@ -1535,6 +1535,7 @@ void ExtensionService::AddComponentExtension(const Extension* extension) {
AddNewOrUpdatedExtension(extension,
Extension::ENABLED_COMPONENT,
extensions::NOT_BLACKLISTED,
+ false,
syncer::StringOrdinal(),
std::string());
return;
@@ -1696,6 +1697,7 @@ void ExtensionService::OnExtensionInstalled(
const syncer::StringOrdinal& page_ordinal,
bool has_requirement_errors,
extensions::BlacklistState blacklist_state,
+ bool is_ephemeral,
benwells 2014/05/19 02:06:53 Could we make ephemerality less central? Do you h
tmdiep 2014/05/19 02:51:16 That would be quite nice actually. One problem is
bool wait_for_idle) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -1790,6 +1792,7 @@ void ExtensionService::OnExtensionInstalled(
extension,
initial_state,
blacklisted_for_malware,
+ is_ephemeral,
extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE,
page_ordinal,
install_parameter);
@@ -1810,6 +1813,7 @@ void ExtensionService::OnExtensionInstalled(
extension,
initial_state,
blacklisted_for_malware,
+ is_ephemeral,
extensions::ExtensionPrefs::DELAY_REASON_GC,
page_ordinal,
install_parameter);
@@ -1820,6 +1824,7 @@ void ExtensionService::OnExtensionInstalled(
extension,
initial_state,
blacklisted_for_malware,
+ is_ephemeral,
extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS,
page_ordinal,
install_parameter);
@@ -1829,6 +1834,7 @@ void ExtensionService::OnExtensionInstalled(
AddNewOrUpdatedExtension(extension,
initial_state,
blacklist_state,
+ is_ephemeral,
page_ordinal,
install_parameter);
}
@@ -1838,6 +1844,7 @@ void ExtensionService::AddNewOrUpdatedExtension(
const Extension* extension,
Extension::State initial_state,
extensions::BlacklistState blacklist_state,
+ bool is_ephemeral,
const syncer::StringOrdinal& page_ordinal,
const std::string& install_parameter) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -1846,6 +1853,7 @@ void ExtensionService::AddNewOrUpdatedExtension(
extension_prefs_->OnExtensionInstalled(extension,
initial_state,
blacklisted_for_malware,
+ is_ephemeral,
page_ordinal,
install_parameter);
delayed_installs_.Remove(extension->id());

Powered by Google App Engine
This is Rietveld 408576698