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

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

Issue 12093036: Move Extension Location and Type enums to Manifest, and move InstallWarning to its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/extension_prefs.h ('k') | chrome/browser/extensions/extension_prefs_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 900acb2c26d4b33eb3c04604357efa74107d491a..38260d1f35c23620a44223a058f6f51b56c3550f 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -43,7 +43,7 @@ namespace {
// Whether this extension was running when chrome last shutdown.
const char kPrefRunning[] = "running";
-// Where an extension was installed from. (see Extension::Location)
+// Where an extension was installed from. (see Manifest::Location)
const char kPrefLocation[] = "location";
// Enabled, disabled, killed, etc. (see Extension::State)
@@ -430,7 +430,7 @@ void ExtensionPrefs::MakePathsRelative() {
continue;
int location_value;
if (extension_dict->GetInteger(kPrefLocation, &location_value) &&
- location_value == Extension::LOAD) {
+ location_value == Manifest::LOAD) {
// Unpacked extensions can have absolute paths.
continue;
}
@@ -1445,7 +1445,7 @@ void ExtensionPrefs::OnExtensionInstalled(
}
void ExtensionPrefs::OnExtensionUninstalled(const std::string& extension_id,
- const Extension::Location& location,
+ const Manifest::Location& location,
bool external_uninstall) {
extension_sorting_->ClearOrdinals(extension_id);
@@ -1453,7 +1453,7 @@ void ExtensionPrefs::OnExtensionUninstalled(const std::string& extension_id,
// and install the extension anymore (except when |external_uninstall| is
// true, which signifies that the registry key was deleted or the pref file
// no longer lists the extension).
- if (!external_uninstall && Extension::IsExternalLocation(location)) {
+ if (!external_uninstall && Manifest::IsExternalLocation(location)) {
UpdateExtensionPref(extension_id, kPrefState,
Value::CreateIntegerValue(
Extension::EXTERNAL_EXTENSION_UNINSTALLED));
@@ -1524,7 +1524,7 @@ std::string ExtensionPrefs::GetVersionString(const std::string& extension_id) {
}
void ExtensionPrefs::UpdateManifest(const Extension* extension) {
- if (extension->location() != Extension::LOAD) {
+ if (extension->location() != Manifest::LOAD) {
const DictionaryValue* extension_dict = GetExtensionPref(extension->id());
if (!extension_dict)
return;
@@ -1612,25 +1612,25 @@ scoped_ptr<ExtensionInfo> ExtensionPrefs::GetInstalledExtensionInfo(
// Make path absolute. Unpacked extensions will already have absolute paths,
// otherwise make it so.
- if (location_value != Extension::LOAD) {
- DCHECK(location_value == Extension::COMPONENT ||
+ if (location_value != Manifest::LOAD) {
+ DCHECK(location_value == Manifest::COMPONENT ||
!FilePath(path).IsAbsolute());
path = install_directory_.Append(path).value();
}
// Only the following extension types can be installed permanently in the
// preferences.
- Extension::Location location =
- static_cast<Extension::Location>(location_value);
- if (location != Extension::INTERNAL &&
- location != Extension::LOAD &&
- !Extension::IsExternalLocation(location)) {
+ Manifest::Location location =
+ static_cast<Manifest::Location>(location_value);
+ if (location != Manifest::INTERNAL &&
+ location != Manifest::LOAD &&
+ !Manifest::IsExternalLocation(location)) {
NOTREACHED();
return scoped_ptr<ExtensionInfo>();
}
const DictionaryValue* manifest = NULL;
- if (location != Extension::LOAD &&
+ if (location != Manifest::LOAD &&
!ext->GetDictionary(kPrefManifest, &manifest)) {
LOG(WARNING) << "Missing manifest for extension " << extension_id;
// Just a warning for now.
@@ -1744,25 +1744,25 @@ scoped_ptr<ExtensionInfo> ExtensionPrefs::GetDelayedInstallInfo(
// Make path absolute. Unpacked extensions will already have absolute paths,
// otherwise make it so.
- if (location_value != Extension::LOAD) {
- DCHECK(location_value == Extension::COMPONENT ||
+ if (location_value != Manifest::LOAD) {
+ DCHECK(location_value == Manifest::COMPONENT ||
!FilePath(path).IsAbsolute());
path = install_directory_.Append(path).value();
}
// Only the following extension types can be installed permanently in the
// preferences.
- Extension::Location location =
- static_cast<Extension::Location>(location_value);
- if (location != Extension::INTERNAL &&
- location != Extension::LOAD &&
- !Extension::IsExternalLocation(location)) {
+ Manifest::Location location =
+ static_cast<Manifest::Location>(location_value);
+ if (location != Manifest::INTERNAL &&
+ location != Manifest::LOAD &&
+ !Manifest::IsExternalLocation(location)) {
NOTREACHED();
return scoped_ptr<ExtensionInfo>();
}
const DictionaryValue* manifest = NULL;
- if (location != Extension::LOAD &&
+ if (location != Manifest::LOAD &&
!ext->GetDictionary(kPrefManifest, &manifest)) {
LOG(WARNING) << "Missing manifest for extension " << extension_id;
// Just a warning for now.
@@ -2317,7 +2317,7 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs(
extension_dict->Set(kPrefPath, Value::CreateStringValue(path));
// We store prefs about LOAD extensions, but don't cache their manifest
// since it may change on disk.
- if (extension->location() != Extension::LOAD) {
+ if (extension->location() != Manifest::LOAD) {
extension_dict->Set(kPrefManifest,
extension->manifest()->value()->DeepCopy());
}
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698