Commit 6ef7f193 authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Move the safe browsing client name from BrowserDistribution to install_static.

This is a continuation of a slow migration from BD to install_static for
brand-specific compile-time constants. There is no behavioral change.

BUG=none
R=nparker@chromium.org

Change-Id: I0a93a2887372b2e89288882a9fae303939673936
Reviewed-on: https://chromium-review.googlesource.com/1195816Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587311}
parent b66ee38d
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include "services/preferences/public/mojom/tracked_preference_validation_delegate.mojom.h" #include "services/preferences/public/mojom/tracked_preference_validation_delegate.mojom.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include "chrome/installer/util/browser_distribution.h" #include "chrome/install_static/install_util.h"
#endif #endif
#if defined(FULL_SAFE_BROWSING) #if defined(FULL_SAFE_BROWSING)
...@@ -343,8 +343,7 @@ std::string SafeBrowsingService::GetProtocolConfigClientName() const { ...@@ -343,8 +343,7 @@ std::string SafeBrowsingService::GetProtocolConfigClientName() const {
// distribution classes in installer util. These classes don't yet have // distribution classes in installer util. These classes don't yet have
// an analog on non-Windows builds so just keep the name specified here. // an analog on non-Windows builds so just keep the name specified here.
#if defined(OS_WIN) #if defined(OS_WIN)
BrowserDistribution* dist = BrowserDistribution::GetDistribution(); client_name = install_static::GetSafeBrowsingName();
client_name = dist->GetSafeBrowsingName();
#else #else
#if defined(GOOGLE_CHROME_BUILD) #if defined(GOOGLE_CHROME_BUILD)
client_name = "googlechrome"; client_name = "googlechrome";
......
...@@ -23,6 +23,8 @@ const wchar_t kBinariesAppGuid[] = L""; ...@@ -23,6 +23,8 @@ const wchar_t kBinariesAppGuid[] = L"";
const wchar_t kBinariesPathName[] = L"Chromium Binaries"; const wchar_t kBinariesPathName[] = L"Chromium Binaries";
const char kSafeBrowsingName[] = "chromium";
const InstallConstants kInstallModes[] = { const InstallConstants kInstallModes[] = {
// The primary (and only) install mode for Chromium. // The primary (and only) install mode for Chromium.
{ {
......
...@@ -23,6 +23,8 @@ const wchar_t kBinariesAppGuid[] = L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}"; ...@@ -23,6 +23,8 @@ const wchar_t kBinariesAppGuid[] = L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}";
// Google Chrome integrates with Google Update, so the app GUID above is used. // Google Chrome integrates with Google Update, so the app GUID above is used.
const wchar_t kBinariesPathName[] = L""; const wchar_t kBinariesPathName[] = L"";
const char kSafeBrowsingName[] = "googlechrome";
const InstallConstants kInstallModes[] = { const InstallConstants kInstallModes[] = {
// The primary install mode for stable Google Chrome. // The primary install mode for stable Google Chrome.
{ {
......
...@@ -69,6 +69,9 @@ extern const wchar_t kBinariesAppGuid[]; ...@@ -69,6 +69,9 @@ extern const wchar_t kBinariesAppGuid[];
// multi-install. Must be empty if the brand integrates with Google Update. // multi-install. Must be empty if the brand integrates with Google Update.
extern const wchar_t kBinariesPathName[]; extern const wchar_t kBinariesPathName[];
// The brand-specific safe browsing client name.
extern const char kSafeBrowsingName[];
// A brand's collection of install modes. // A brand's collection of install modes.
extern const InstallConstants kInstallModes[]; extern const InstallConstants kInstallModes[];
......
...@@ -431,6 +431,10 @@ const wchar_t* GetSandboxSidPrefix() { ...@@ -431,6 +431,10 @@ const wchar_t* GetSandboxSidPrefix() {
return InstallDetails::Get().mode().sandbox_sid_prefix; return InstallDetails::Get().mode().sandbox_sid_prefix;
} }
std::string GetSafeBrowsingName() {
return kSafeBrowsingName;
}
bool GetCollectStatsConsent() { bool GetCollectStatsConsent() {
bool enabled = true; bool enabled = true;
......
...@@ -137,6 +137,9 @@ int GetIconResourceIndex(); ...@@ -137,6 +137,9 @@ int GetIconResourceIndex();
// Get sandbox id of current install mode. // Get sandbox id of current install mode.
const wchar_t* GetSandboxSidPrefix(); const wchar_t* GetSandboxSidPrefix();
// Returns the brand-specific safe browsing client name.
std::string GetSafeBrowsingName();
// Returns true if usage stats collecting is enabled for this user for the // Returns true if usage stats collecting is enabled for this user for the
// current executable. // current executable.
bool GetCollectStatsConsent(); bool GetCollectStatsConsent();
......
...@@ -121,10 +121,6 @@ base::string16 BrowserDistribution::GetLongAppDescription() { ...@@ -121,10 +121,6 @@ base::string16 BrowserDistribution::GetLongAppDescription() {
return app_description; return app_description;
} }
std::string BrowserDistribution::GetSafeBrowsingName() {
return "chromium";
}
base::string16 BrowserDistribution::GetDistributionData(HKEY root_key) { base::string16 BrowserDistribution::GetDistributionData(HKEY root_key) {
return L""; return L"";
} }
......
...@@ -66,8 +66,6 @@ class BrowserDistribution { ...@@ -66,8 +66,6 @@ class BrowserDistribution {
virtual base::string16 GetLongAppDescription(); virtual base::string16 GetLongAppDescription();
virtual std::string GetSafeBrowsingName();
#if defined(OS_WIN) #if defined(OS_WIN)
virtual base::string16 GetDistributionData(HKEY root_key); virtual base::string16 GetDistributionData(HKEY root_key);
#endif #endif
......
...@@ -145,10 +145,6 @@ base::string16 GoogleChromeDistribution::GetAppDescription() { ...@@ -145,10 +145,6 @@ base::string16 GoogleChromeDistribution::GetAppDescription() {
return app_description; return app_description;
} }
std::string GoogleChromeDistribution::GetSafeBrowsingName() {
return "googlechrome";
}
base::string16 GoogleChromeDistribution::GetDistributionData(HKEY root_key) { base::string16 GoogleChromeDistribution::GetDistributionData(HKEY root_key) {
base::string16 sub_key(google_update::kRegPathClientState); base::string16 sub_key(google_update::kRegPathClientState);
sub_key.append(L"\\"); sub_key.append(L"\\");
......
...@@ -30,8 +30,6 @@ class GoogleChromeDistribution : public BrowserDistribution { ...@@ -30,8 +30,6 @@ class GoogleChromeDistribution : public BrowserDistribution {
base::string16 GetAppDescription() override; base::string16 GetAppDescription() override;
std::string GetSafeBrowsingName() override;
// This method reads data from the Google Update ClientState key for // This method reads data from the Google Update ClientState key for
// potential use in the uninstall survey. It must be called before the // potential use in the uninstall survey. It must be called before the
// key returned by GetVersionKey() is deleted. // key returned by GetVersionKey() is deleted.
......
...@@ -48,10 +48,6 @@ base::string16 GoogleChromeDistribution::GetAppDescription() { ...@@ -48,10 +48,6 @@ base::string16 GoogleChromeDistribution::GetAppDescription() {
return base::string16(); return base::string16();
} }
std::string GoogleChromeDistribution::GetSafeBrowsingName() {
return std::string();
}
base::string16 GoogleChromeDistribution::GetDistributionData(HKEY root_key) { base::string16 GoogleChromeDistribution::GetDistributionData(HKEY root_key) {
return base::string16(); return base::string16();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment