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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 273193006: Install Chrome OS apps to shared location (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added uninstall 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: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index e9b4a765facb73e3a9b1ca20767a5690a221f6dd..fccaa411e7385698855d9e9a6b810dfb04873ee6 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -1329,19 +1329,6 @@ void ExtensionPrefs::UpdateManifest(const Extension* extension) {
}
}
-base::FilePath ExtensionPrefs::GetExtensionPath(
- const std::string& extension_id) {
- const base::DictionaryValue* dict = GetExtensionPref(extension_id);
- if (!dict)
- return base::FilePath();
-
- std::string path;
- if (!dict->GetString(kPrefPath, &path))
- return base::FilePath();
-
- return install_directory_.Append(base::FilePath::FromUTF8Unsafe(path));
-}
-
scoped_ptr<ExtensionInfo> ExtensionPrefs::GetInstalledInfoHelper(
const std::string& extension_id,
const base::DictionaryValue* extension) const {
@@ -1356,9 +1343,15 @@ scoped_ptr<ExtensionInfo> ExtensionPrefs::GetInstalledInfoHelper(
// Make path absolute. Unpacked extensions will already have absolute paths,
// otherwise make it so.
Manifest::Location location = static_cast<Manifest::Location>(location_value);
+#if !defined(OS_CHROMEOS)
if (!Manifest::IsUnpackedLocation(location)) {
DCHECK(location == Manifest::COMPONENT ||
!base::FilePath(path).IsAbsolute());
+#else
+ // On Chrome OS some extensions can be installed to shared location and
+ // thus use absolute paths in prefs.
+ if (!base::FilePath(path).IsAbsolute()) {
+#endif // !defined(OS_CHROMEOS)
path = install_directory_.Append(path).value();
}

Powered by Google App Engine
This is Rietveld 408576698