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

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: comment fixed 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
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | no next file » | 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 2ebbadd38b35e6fd07312e48b9373f62a0d5673b..665d3643e97aac1e46971c35c310648bd4a0e16f 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -1339,19 +1339,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 {
@@ -1366,9 +1353,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();
}
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698