summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/chrome_paths.cc14
-rw-r--r--chrome/common/chrome_paths.h4
-rw-r--r--chrome/common/chrome_paths_internal.h4
-rw-r--r--chrome/common/chrome_paths_mac.mm4
4 files changed, 26 insertions, 0 deletions
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index 6f77510..181cf0a 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -295,6 +295,20 @@ bool PathProvider(int key, FilePath* result) {
break;
}
#endif
+#if defined(OS_MACOSX)
+ case chrome::DIR_MANAGED_PREFS: {
+ if (!GetLocalLibraryDirectory(&cur))
+ return false;
+ cur = cur.Append(FILE_PATH_LITERAL("Managed Preferences"));
+ char* login = getlogin();
+ if (!login)
+ return false;
+ cur = cur.AppendASCII(login);
+ if (!file_util::PathExists(cur)) // we don't want to create this
+ return false;
+ break;
+ }
+#endif
default:
return false;
}
diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h
index 65538a7..63037c6 100644
--- a/chrome/common/chrome_paths.h
+++ b/chrome/common/chrome_paths.h
@@ -42,6 +42,10 @@ enum {
// to set policies for chrome. This directory
// contains subdirectories.
#endif
+#if defined(OS_MACOSX)
+ DIR_MANAGED_PREFS, // Directory that stores the managed prefs plist
+ // files for the current user.
+#endif
FILE_RESOURCE_MODULE, // Full path and filename of the module that
// contains embedded resources (version,
// strings, images, etc.).
diff --git a/chrome/common/chrome_paths_internal.h b/chrome/common/chrome_paths_internal.h
index 38fbac2..6671e25 100644
--- a/chrome/common/chrome_paths_internal.h
+++ b/chrome/common/chrome_paths_internal.h
@@ -55,6 +55,10 @@ void SetOverrideVersionedDirectory(const FilePath* path);
// framework are things that also depend on the framework, such as the helper
// app bundle.
FilePath GetFrameworkBundlePath();
+
+// Get the local library directory.
+bool GetLocalLibraryDirectory(FilePath* result);
+
#endif // OS_MACOSX
} // namespace chrome
diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm
index c7db483..b87b397 100644
--- a/chrome/common/chrome_paths_mac.mm
+++ b/chrome/common/chrome_paths_mac.mm
@@ -105,4 +105,8 @@ FilePath GetFrameworkBundlePath() {
return GetVersionedDirectory().Append(kFrameworkName);
}
+bool GetLocalLibraryDirectory(FilePath* result) {
+ return mac_util::GetLocalDirectory(NSLibraryDirectory, result);
+}
+
} // namespace chrome