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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 1497193002: Remove all the ephemeral apps code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review, Devlin review. Created 5 years 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 | « extensions/browser/extension_prefs.h ('k') | extensions/browser/extension_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index 78a966fe25c9a1f5fd0c4fa9ffe46c94250c075f..e7436f84cdb9b1a95ab415037bdfd15cf1121623 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -169,9 +169,6 @@ const char kPrefGeometryCache[] = "geometry_cache";
// A preference that indicates when an extension is last launched.
const char kPrefLastLaunchTime[] = "last_launch_time";
-// A preference indicating whether the extension is an ephemeral app.
-const char kPrefEphemeralApp[] = "ephemeral_app";
-
// Am installation parameter bundled with an extension.
const char kPrefInstallParam[] = "install_parameter";
@@ -1173,12 +1170,8 @@ void ExtensionPrefs::OnExtensionInstalled(
install_parameter,
extension_dict);
- bool requires_sort_ordinal = extension->RequiresSortOrdinal() &&
- (install_flags & kInstallFlagIsEphemeral) == 0;
- FinishExtensionInfoPrefs(extension->id(),
- install_time,
- requires_sort_ordinal,
- page_ordinal,
+ FinishExtensionInfoPrefs(extension->id(), install_time,
+ extension->RequiresSortOrdinal(), page_ordinal,
extension_dict);
}
@@ -1398,8 +1391,7 @@ void ExtensionPrefs::SetDelayedInstallInfo(
// Add transient data that is needed by FinishDelayedInstallInfo(), but
// should not be in the final extension prefs. All entries here should have
// a corresponding Remove() call in FinishDelayedInstallInfo().
- if (extension->RequiresSortOrdinal() &&
- (install_flags & kInstallFlagIsEphemeral) == 0) {
+ if (extension->RequiresSortOrdinal()) {
extension_dict->SetString(
kPrefSuggestedPageOrdinal,
page_ordinal.IsValid() ? page_ordinal.ToInternalValue()
@@ -1450,11 +1442,6 @@ bool ExtensionPrefs::FinishDelayedInstallInfo(
new base::StringValue(
base::Int64ToString(install_time.ToInternalValue())));
- // Some extension pref values are written conditionally. If they are not
- // present in the delayed install data, they should be removed when the
- // delayed install is committed.
- extension_dict->Remove(kPrefEphemeralApp, NULL);
-
// Commit the delayed install data.
for (base::DictionaryValue::Iterator it(*pending_install_dict); !it.IsAtEnd();
it.Advance()) {
@@ -1516,33 +1503,6 @@ scoped_ptr<ExtensionPrefs::ExtensionsInfo> ExtensionPrefs::
return extensions_info.Pass();
}
-bool ExtensionPrefs::IsEphemeralApp(const std::string& extension_id) const {
- if (ReadPrefAsBooleanAndReturn(extension_id, kPrefEphemeralApp))
- return true;
-
- // Ephemerality was previously stored in the creation flags, so we must also
- // check it for backcompatibility.
- return (GetCreationFlags(extension_id) & Extension::IS_EPHEMERAL) != 0;
-}
-
-void ExtensionPrefs::OnEphemeralAppPromoted(const std::string& extension_id) {
- DCHECK(IsEphemeralApp(extension_id));
-
- UpdateExtensionPref(extension_id, kPrefEphemeralApp, NULL);
-
- // Ephemerality was previously stored in the creation flags, so ensure the bit
- // is cleared.
- int creation_flags = Extension::NO_FLAGS;
- if (ReadPrefAsInteger(extension_id, kPrefCreationFlags, &creation_flags)) {
- if (creation_flags & Extension::IS_EPHEMERAL) {
- creation_flags &= ~static_cast<int>(Extension::IS_EPHEMERAL);
- UpdateExtensionPref(extension_id,
- kPrefCreationFlags,
- new base::FundamentalValue(creation_flags));
- }
- }
-}
-
bool ExtensionPrefs::WasAppDraggedByUser(
const std::string& extension_id) const {
return ReadPrefAsBooleanAndReturn(extension_id, kPrefUserDraggedApp);
@@ -1994,11 +1954,6 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs(
if (install_flags & kInstallFlagIsBlacklistedForMalware)
extension_dict->Set(kPrefBlacklist, new base::FundamentalValue(true));
- if (install_flags & kInstallFlagIsEphemeral)
- extension_dict->Set(kPrefEphemeralApp, new base::FundamentalValue(true));
- else
- extension_dict->Remove(kPrefEphemeralApp, NULL);
-
base::FilePath::StringType path = MakePathRelative(install_directory_,
extension->path());
extension_dict->Set(kPrefPath, new base::StringValue(path));
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | extensions/browser/extension_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698