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

Unified Diff: chrome/install_static/install_util.h

Issue 1913943003: Remove dependencies on chrome\installer from the ChromeCrashReporterClient class on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 8 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: chrome/install_static/install_util.h
diff --git a/chrome/install_static/install_util.h b/chrome/install_static/install_util.h
index 600748ed865d5fa02b66be2833acb8c39e3cdc08..7122c59e00e87b573cf54357801a6ee01ef0803a 100644
--- a/chrome/install_static/install_util.h
+++ b/chrome/install_static/install_util.h
@@ -9,14 +9,25 @@
#ifndef CHROME_INSTALL_STATIC_INSTALL_UTIL_H_
#define CHROME_INSTALL_STATIC_INSTALL_UTIL_H_
+#include "base/files/file_path.h"
#include "base/strings/string16.h"
+#include "base/version.h"
+namespace install_static {
enum class ProcessType {
UNINITIALIZED,
NON_BROWSER_PROCESS,
BROWSER_PROCESS,
};
+// Chrome channel display names.
+extern const wchar_t kChromeChannelUnknown[];
+extern const wchar_t kChromeChannelCanary[];
+extern const wchar_t kChromeChannelDev[];
+extern const wchar_t kChromeChannelBeta[];
+extern const wchar_t kChromeChannelStable[];
+extern const wchar_t kChromeChannelStableExplicit[];
+
// Returns true if |exe_path| points to a Chrome installed in an SxS
// installation.
bool IsCanary(const wchar_t* exe_path);
@@ -28,21 +39,85 @@ bool IsSystemInstall(const wchar_t* exe_path);
bool IsMultiInstall(bool is_system_install);
// Returns true if usage stats collecting is enabled for this user.
-bool AreUsageStatsEnabled(const wchar_t* exe_path);
+bool GetCollectStatsConsent();
-// Returns true if a policy is in effect. |breakpad_enabled| will be set to true
-// if stats collecting is permitted by this policy and false if not.
+// Returns true if a policy is in effect. |breakpad_enabled| will be set to
+// true if stats collecting is permitted by this policy and false if not.
bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled);
-// Initializes |g_process_type| which stores whether or not the current process
-// is the main browser process.
+// Initializes |g_process_type| which stores whether or not the current
+// process is the main browser process.
void InitializeProcessType();
// Returns true if invoked in a Chrome process other than the main browser
// process. False otherwise.
bool IsNonBrowserProcess();
+// Get the path to the user's data directory, regardless of whether
+// DIR_USER_DATA has been overridden by a command-line option.
+// TODO(ananta)
scottmg 2016/04/26 20:44:47 Add the crbug link on these TODOs.
ananta 2016/04/26 21:33:09 Done.
+// Unify this with the Browser Distribution code.
+bool GetDefaultUserDataDirectory(base::FilePath* result);
+
+// Populates |crash_dir| with the default crash dump location regardless of
+// whether DIR_USER_DATA or DIR_CRASH_DUMPS has been overridden.
+// TODO(ananta)
+// Unify this with the Browser Distribution code.
+bool GetDefaultCrashDumpLocation(base::FilePath* crash_dir);
+
+// Returns the contents of the specified |variable_name| from the environment
+// block of the calling process. Returns an empty string if the variable does
+// not exist.
+std::string GetEnvironmentString(const std::string& variable_name);
+
+// Sets the environment variable identified by |variable_name| to the value
+// identified by |new_value|.
+bool SetEnvironmentString(const std::string& variable_name,
+ const std::string& new_value);
+
+// Returns true if the environment variable identified by |variable_name|
+// exists.
+bool HasEnvironmentVariable(const std::string& variable_name);
+
+// Gets the exe version details like the |product_name|, |version|,
+// |special_build|, |channel_name|, etc. Most of this information is read
+// from the version resource. |exe_path| is the path of chrome.exe.
+// TODO(ananta)
+// Unify this with the Browser Distribution code.
+bool GetExecutableVersionDetails(const base::string16& exe_path,
+ base::string16* product_name,
+ base::string16* version,
+ base::string16* special_build,
+ base::string16* channel_name);
+
+// Gets the channel name for the current Chrome process.
+// TODO(ananta)
+// Unify this with the Browser Distribution code.
+void GetChromeChannelName(bool is_per_user_install,
+ base::string16* channel_name);
+
+
+// Returns the version of Google Update that is installed.
+// TODO(ananta)
+// Unify this with the Browser Distribution code.
+base::Version GetGoogleUpdateVersion();
+
+// Returns the Chrome installation subdirectory, i.e. Google Chrome\Chromium,
+// etc.
+// TODO(ananta)
+// Unify this with the Browser Distribution code.
+base::string16 GetChromeInstallSubDirectory();
+
+// Returns the registry path where the browser crash dumps metrics need to be
+// written to.
+// TODO(ananta)
+// Unify this with the version in
+// chrome\common\metrics_constants_util_win.cc
+base::string16 GetBrowserCrashDumpAttemptsRegistryPath();
+
// Caches the |ProcessType| of the current process.
extern ProcessType g_process_type;
+} // namespace install_static
+
#endif // CHROME_INSTALL_STATIC_INSTALL_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698