Index: chrome/install_static/product_install_details.h |
diff --git a/chrome/install_static/product_install_details.h b/chrome/install_static/product_install_details.h |
index 54843b6c7c051de4870f41c4897404724c8e3952..ae5ceb572f2fe11ce1b1fe58b90197c861464201 100644 |
--- a/chrome/install_static/product_install_details.h |
+++ b/chrome/install_static/product_install_details.h |
@@ -13,6 +13,7 @@ |
namespace install_static { |
struct InstallConstants; |
+class InstallDetails; |
class PrimaryInstallDetails; |
// Creates product details for the current process and sets them as the global |
@@ -40,6 +41,35 @@ std::wstring GetInstallSuffix(const std::wstring& exe_path); |
// being multi-install. |
bool IsMultiInstall(const InstallConstants& mode, bool system_level); |
+// Populates |result| with the default User Data directory for the current |
+// user. Returns false if all attempts at locating a User Data directory fail. |
+// TODO(ananta) |
+// http://crbug.com/604923 |
+// Unify this with the Browser Distribution code. |
+bool GetDefaultUserDataDirectory(const InstallDetails& details, |
+ std::wstring* result); |
+ |
+// Populates |result| with the user data dir, respecting various overrides in |
+// the manner of chrome_main_delegate.cc InitializeUserDataDir(). This includes |
+// overrides on the command line, overrides by registry policy, and fallback to |
+// the default User Data dir if the directory is invalid or unspecified. |
+// |
+// If a directory was given by the user (either on the command line, or by |
+// registry policy), but it was invalid or unusable, then |
+// |invalid_supplied_directory| will be filled with the value that was unusable |
+// for reporting an error to the user. |
+// |
+// Other than in test situations, it is generally only appropriate to call this |
+// function once on startup and use the result for subsequent callers, otherwise |
+// there's a race with registry modification (which could cause a different |
+// derivation) so different subsystems would see different values). In normal |
+// usage, this will be called once at startup and saved into InstallDetails |
+// from where it should be retrieved. |
+bool GetUserDataDirectory(const std::wstring& user_data_dir_from_command_line, |
+ const InstallDetails& details, |
+ std::wstring* result, |
+ std::wstring* invalid_supplied_directory); |
+ |
// Creates product details for the process at |exe_path|. |
std::unique_ptr<PrimaryInstallDetails> MakeProductDetails( |
const std::wstring& exe_path); |