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

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: Update comment 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..0b3c7b7fd467c874deb4cfc4fdbbc49f68900030 100644
--- a/chrome/install_static/install_util.h
+++ b/chrome/install_static/install_util.h
@@ -11,12 +11,21 @@
#include "base/strings/string16.h"
+namespace install_static {
grt (UTC plus 2) 2016/04/29 20:50:57 nit: blank line after this
ananta 2016/04/29 22:49:25 Done.
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);
grt (UTC plus 2) 2016/04/29 20:50:57 in general "SxS" is used to name the "the Chrome i
ananta 2016/04/29 22:49:24 Changed to IsSxSChrome
@@ -27,22 +36,107 @@ bool IsSystemInstall(const wchar_t* exe_path);
// Returns true if current installation of Chrome is a multi-install.
bool IsMultiInstall(bool is_system_install);
-// Returns true if usage stats collecting is enabled for this user.
-bool AreUsageStatsEnabled(const wchar_t* exe_path);
+// Returns true if usage stats collecting is enabled for this user for the
+// current executable.
+bool GetCollectStatsConsent();
+
+// Returns true if usage stats collecting is enabled for this user for the
+// executable passed in as |exe_path|.
+// Only used by tests.
+bool GetCollectStatsConsentForTesting(const base::string16& exe_path);
-// 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
grt (UTC plus 2) 2016/04/29 20:50:57 "if a policy is in effect" -> "if usage stats repo
ananta 2016/04/29 22:49:24 Done.
+// 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
grt (UTC plus 2) 2016/04/29 20:50:57 nit: "Populates |result| with the default User Dat
ananta 2016/04/29 22:49:24 Done.
+// DIR_USER_DATA has been overridden by a command-line option.
+// TODO(ananta)
+// http://crbug.com/604923
+// Unify this with the Browser Distribution code.
+bool GetDefaultUserDataDirectory(base::string16* 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)
+// http://crbug.com/604923
+// Unify this with the Browser Distribution code.
+bool GetDefaultCrashDumpLocation(base::string16* 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)
+// http://crbug.com/604923
+// 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)
+// http://crbug.com/604923
+// 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)
+// http://crbug.com/604923
+// Unify this with the Browser Distribution code.
+std::string GetGoogleUpdateVersion();
+
+// Returns the Chrome installation subdirectory, i.e. Google Chrome\Chromium,
+// etc.
+// TODO(ananta)
+// http://crbug.com/604923
+// 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)
+// http://crbug.com/604923
+// Unify this with the version in
+// chrome\common\metrics_constants_util_win.cc
+base::string16 GetBrowserCrashDumpAttemptsRegistryPath();
+
+// Returns true if the |source| string matches the |pattern|. The pattern
+// may contain wildcards like '?', which matches one character or a '*'
+// which matches 0 or more characters.
+// Please note that pattern matches the whole string. If you want to find
+// something in the middle of the string then you need to specify the pattern
+// as '*xyz*'.
+bool MatchPattern(const base::string16& source, const base::string16& pattern);
+
// 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