summaryrefslogtreecommitdiffstats
path: root/extensions/browser/extension_prefs.cc
diff options
context:
space:
mode:
authorbenwells <benwells@chromium.org>2015-12-08 18:20:24 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-09 02:21:38 +0000
commit1dd4acd3139eece0998bc422738b4d1b41462fca (patch)
treec47ebe6a9af3c1aa9e5f5f9c6f2c898a708cb1ea /extensions/browser/extension_prefs.cc
parente1858d8614321b276e3588a514262f1553a3c272 (diff)
downloadchromium_src-1dd4acd3139eece0998bc422738b4d1b41462fca.zip
chromium_src-1dd4acd3139eece0998bc422738b4d1b41462fca.tar.gz
chromium_src-1dd4acd3139eece0998bc422738b4d1b41462fca.tar.bz2
Remove all the ephemeral apps code.
BUG=517735 Review URL: https://codereview.chromium.org/1497193002 Cr-Commit-Position: refs/heads/master@{#363918}
Diffstat (limited to 'extensions/browser/extension_prefs.cc')
-rw-r--r--extensions/browser/extension_prefs.cc51
1 files changed, 3 insertions, 48 deletions
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index 78a966f..e7436f8 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));