Commit 4d7b41a0 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

More GOOGLE_CHROME_BUILD -> GOOGLE_CHROME_BRANDING.

Changes some new uses, and does fairly harmless modifications
to keep GOOGLE_CHROME_BRANDING out of .h files.

Bug: 961769
Change-Id: Ia273654e515c1ba07cbd91b51937422d792a9f9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1882110Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709895}
parent b01a24a4
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/login/test/oobe_screens_utils.h" #include "chrome/browser/chromeos/login/test/oobe_screens_utils.h"
#include "build/branding_buildflags.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/login/oobe_screen.h" #include "chrome/browser/chromeos/login/oobe_screen.h"
#include "chrome/browser/chromeos/login/screens/sync_consent_screen.h" #include "chrome/browser/chromeos/login/screens/sync_consent_screen.h"
...@@ -123,10 +124,8 @@ void SkipToEnrollmentOnRecovery() { ...@@ -123,10 +124,8 @@ void SkipToEnrollmentOnRecovery() {
test::WaitForNetworkSelectionScreen(); test::WaitForNetworkSelectionScreen();
test::TapNetworkSelectionNext(); test::TapNetworkSelectionNext();
#if defined(GOOGLE_CHROME_BUILD)
WaitForEulaScreen(); WaitForEulaScreen();
TapEulaAccept(); TapEulaAccept();
#endif
test::WaitForUpdateScreen(); test::WaitForUpdateScreen();
test::ExitUpdateScreenNoUpdate(); test::ExitUpdateScreenNoUpdate();
...@@ -138,20 +137,26 @@ void WaitForEnrollmentScreen() { ...@@ -138,20 +137,26 @@ void WaitForEnrollmentScreen() {
WaitFor(EnrollmentScreenView::kScreenId); WaitFor(EnrollmentScreenView::kScreenId);
} }
#if defined(GOOGLE_CHROME_BUILD)
void WaitForEulaScreen() { void WaitForEulaScreen() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
WaitFor(EulaView::kScreenId); WaitFor(EulaView::kScreenId);
#endif
} }
void TapEulaAccept() { void TapEulaAccept() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
test::OobeJS().TapOnPath({"oobe-eula-md", "acceptButton"}); test::OobeJS().TapOnPath({"oobe-eula-md", "acceptButton"});
#endif
} }
void WaitForSyncConsentScreen() { void WaitForSyncConsentScreen() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
WaitFor(SyncConsentScreenView::kScreenId); WaitFor(SyncConsentScreenView::kScreenId);
#endif
} }
void ExitScreenSyncConsent() { void ExitScreenSyncConsent() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
SyncConsentScreen* screen = static_cast<SyncConsentScreen*>( SyncConsentScreen* screen = static_cast<SyncConsentScreen*>(
WizardController::default_controller()->GetScreen( WizardController::default_controller()->GetScreen(
SyncConsentScreenView::kScreenId)); SyncConsentScreenView::kScreenId));
...@@ -159,8 +164,8 @@ void ExitScreenSyncConsent() { ...@@ -159,8 +164,8 @@ void ExitScreenSyncConsent() {
screen->SetProfileSyncDisabledByPolicyForTesting(true); screen->SetProfileSyncDisabledByPolicyForTesting(true);
screen->OnStateChanged(nullptr); screen->OnStateChanged(nullptr);
WaitForExit(SyncConsentScreenView::kScreenId); WaitForExit(SyncConsentScreenView::kScreenId);
}
#endif #endif
}
} // namespace test } // namespace test
} // namespace chromeos } // namespace chromeos
...@@ -22,12 +22,10 @@ void ExitDiscoverPinSetupScreen(); ...@@ -22,12 +22,10 @@ void ExitDiscoverPinSetupScreen();
void SkipToEnrollmentOnRecovery(); void SkipToEnrollmentOnRecovery();
void WaitForEnrollmentScreen(); void WaitForEnrollmentScreen();
#if defined(GOOGLE_CHROME_BUILD)
void WaitForEulaScreen(); void WaitForEulaScreen();
void TapEulaAccept(); void TapEulaAccept();
void WaitForSyncConsentScreen(); void WaitForSyncConsentScreen();
void ExitScreenSyncConsent(); void ExitScreenSyncConsent();
#endif
} // namespace test } // namespace test
} // namespace chromeos } // namespace chromeos
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h" #include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -113,7 +114,7 @@ bool AreSigninCookiesClearedOnExit(Profile* profile) { ...@@ -113,7 +114,7 @@ bool AreSigninCookiesClearedOnExit(Profile* profile) {
return client->AreSigninCookiesDeletedOnExit(); return client->AreSigninCookiesDeletedOnExit();
} }
#if defined(GOOGLE_CHROME_BUILD) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// Returns the Google G icon in grey and with a padding of 2. The padding is // Returns the Google G icon in grey and with a padding of 2. The padding is
// needed to make the icon look smaller, otherwise it looks too big compared to // needed to make the icon look smaller, otherwise it looks too big compared to
// the other icons. See crbug.com/951751 for more information. // the other icons. See crbug.com/951751 for more information.
...@@ -594,7 +595,7 @@ void ProfileMenuView::BuildFeatureButtons() { ...@@ -594,7 +595,7 @@ void ProfileMenuView::BuildFeatureButtons() {
if (has_unconsented_account) { if (has_unconsented_account) {
AddFeatureButton( AddFeatureButton(
#if defined(GOOGLE_CHROME_BUILD) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// The Google G icon needs to be shrunk, so it won't look too big // The Google G icon needs to be shrunk, so it won't look too big
// compared to the other icons. // compared to the other icons.
ImageForMenu(kGoogleGLogoIcon, /*icon_to_image_ratio=*/0.75), ImageForMenu(kGoogleGLogoIcon, /*icon_to_image_ratio=*/0.75),
...@@ -691,13 +692,11 @@ void ProfileMenuView::AddProfileMenuView(AvatarMenu* avatar_menu) { ...@@ -691,13 +692,11 @@ void ProfileMenuView::AddProfileMenuView(AvatarMenu* avatar_menu) {
AddGuestProfileView(); AddGuestProfileView();
} }
#if defined(GOOGLE_CHROME_BUILD)
if (dice_enabled_ && !dice_accounts_.empty() && if (dice_enabled_ && !dice_accounts_.empty() &&
!SigninErrorControllerFactory::GetForProfile(browser()->profile()) !SigninErrorControllerFactory::GetForProfile(browser()->profile())
->HasError()) { ->HasError()) {
AddManageGoogleAccountButton(); AddManageGoogleAccountButton();
} }
#endif
if (browser()->profile()->IsSupervised()) if (browser()->profile()->IsSupervised())
AddSupervisedUserDisclaimerView(); AddSupervisedUserDisclaimerView();
...@@ -1093,16 +1092,16 @@ void ProfileMenuView::AddAutofillHomeView() { ...@@ -1093,16 +1092,16 @@ void ProfileMenuView::AddAutofillHomeView() {
base::Unretained(this))); base::Unretained(this)));
} }
#if defined(GOOGLE_CHROME_BUILD)
void ProfileMenuView::AddManageGoogleAccountButton() { void ProfileMenuView::AddManageGoogleAccountButton() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
AddMenuGroup(false); AddMenuGroup(false);
CreateAndAddButton( CreateAndAddButton(
GetGoogleIconForUserMenu(GetDefaultIconSize()), GetGoogleIconForUserMenu(GetDefaultIconSize()),
l10n_util::GetStringUTF16(IDS_SETTINGS_MANAGE_GOOGLE_ACCOUNT), l10n_util::GetStringUTF16(IDS_SETTINGS_MANAGE_GOOGLE_ACCOUNT),
base::BindRepeating(&ProfileMenuView::OnManageGoogleAccountButtonClicked, base::BindRepeating(&ProfileMenuView::OnManageGoogleAccountButtonClicked,
base::Unretained(this))); base::Unretained(this)));
}
#endif #endif
}
void ProfileMenuView::PostActionPerformed( void ProfileMenuView::PostActionPerformed(
ProfileMetrics::ProfileDesktopMenu action_performed) { ProfileMetrics::ProfileDesktopMenu action_performed) {
......
...@@ -99,9 +99,7 @@ class ProfileMenuView : public ProfileMenuViewBase, public AvatarMenuObserver { ...@@ -99,9 +99,7 @@ class ProfileMenuView : public ProfileMenuViewBase, public AvatarMenuObserver {
void AddOptionsView(bool display_lock, AvatarMenu* avatar_menu); void AddOptionsView(bool display_lock, AvatarMenu* avatar_menu);
void AddSupervisedUserDisclaimerView(); void AddSupervisedUserDisclaimerView();
void AddAutofillHomeView(); void AddAutofillHomeView();
#if defined(GOOGLE_CHROME_BUILD)
void AddManageGoogleAccountButton(); void AddManageGoogleAccountButton();
#endif
// Adds the DICE UI view to sign in and turn on sync. It includes an // Adds the DICE UI view to sign in and turn on sync. It includes an
// illustration, a promo and a button. // illustration, a promo and a button.
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/metrics/field_trial_params.h" #include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h" #include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -81,7 +82,7 @@ class AdvancedViewContainer : public views::View { ...@@ -81,7 +82,7 @@ class AdvancedViewContainer : public views::View {
bool UseGoogleTranslateBranding() { bool UseGoogleTranslateBranding() {
// Only use Google Translate branding in Chrome branded builds. // Only use Google Translate branding in Chrome branded builds.
#if defined(GOOGLE_CHROME_BUILD) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return true; return true;
#else #else
return false; return false;
......
...@@ -195,7 +195,7 @@ UpgradeDetectorImpl::UpgradeDetectorImpl(const base::Clock* clock, ...@@ -195,7 +195,7 @@ UpgradeDetectorImpl::UpgradeDetectorImpl(const base::Clock* clock,
// Also note that to test with a given time/date, until the network time // Also note that to test with a given time/date, until the network time
// tracking moves off of the VariationsService, the "variations-server-url" // tracking moves off of the VariationsService, the "variations-server-url"
// command line switch must also be specified for the service to be // command line switch must also be specified for the service to be
// available on non GOOGLE_CHROME_BUILD. // available on non GOOGLE_CHROME_BRANDING.
std::string switch_name; std::string switch_name;
if (cmd_line.HasSwitch(switches::kSimulateOutdatedNoAU)) { if (cmd_line.HasSwitch(switches::kSimulateOutdatedNoAU)) {
is_auto_update_enabled_ = false; is_auto_update_enabled_ = false;
...@@ -230,7 +230,7 @@ UpgradeDetectorImpl::UpgradeDetectorImpl(const base::Clock* clock, ...@@ -230,7 +230,7 @@ UpgradeDetectorImpl::UpgradeDetectorImpl(const base::Clock* clock,
#if defined(OS_WIN) #if defined(OS_WIN)
// Only enable upgrade notifications for Google Chrome builds. Chromium does not // Only enable upgrade notifications for Google Chrome builds. Chromium does not
// use an auto-updater. // use an auto-updater.
#if defined(GOOGLE_CHROME_BUILD) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// There might be a policy/enterprise environment preventing updates, so // There might be a policy/enterprise environment preventing updates, so
// validate updatability and then call StartTimerForUpgradeCheck // validate updatability and then call StartTimerForUpgradeCheck
// appropriately. Skip this step if a past attempt has been made to enable // appropriately. Skip this step if a past attempt has been made to enable
...@@ -246,7 +246,7 @@ UpgradeDetectorImpl::UpgradeDetectorImpl(const base::Clock* clock, ...@@ -246,7 +246,7 @@ UpgradeDetectorImpl::UpgradeDetectorImpl(const base::Clock* clock,
base::BindOnce(&UpgradeDetectorImpl::OnAutoupdatesEnabledResult, base::BindOnce(&UpgradeDetectorImpl::OnAutoupdatesEnabledResult,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} }
#endif // defined(GOOGLE_CHROME_BUILD) #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#else // defined(OS_WIN) #else // defined(OS_WIN)
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Only enable upgrade notifications if the updater (Keystone) is present. // Only enable upgrade notifications if the updater (Keystone) is present.
...@@ -578,14 +578,14 @@ void UpgradeDetectorImpl::OnRelaunchNotificationPeriodPrefChanged() { ...@@ -578,14 +578,14 @@ void UpgradeDetectorImpl::OnRelaunchNotificationPeriodPrefChanged() {
NotifyOnUpgrade(); NotifyOnUpgrade();
} }
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) #if defined(OS_WIN)
void UpgradeDetectorImpl::OnAutoupdatesEnabledResult( void UpgradeDetectorImpl::OnAutoupdatesEnabledResult(
bool auto_updates_enabled) { bool auto_updates_enabled) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
is_auto_update_enabled_ = auto_updates_enabled; is_auto_update_enabled_ = auto_updates_enabled;
StartTimerForUpgradeCheck(); StartTimerForUpgradeCheck();
} }
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) #endif // defined(OS_WIN)
void UpgradeDetectorImpl::NotifyOnUpgrade() { void UpgradeDetectorImpl::NotifyOnUpgrade() {
const base::TimeDelta time_passed = clock()->Now() - upgrade_detected_time(); const base::TimeDelta time_passed = clock()->Now() - upgrade_detected_time();
......
...@@ -88,7 +88,7 @@ class UpgradeDetectorImpl : public UpgradeDetector, ...@@ -88,7 +88,7 @@ class UpgradeDetectorImpl : public UpgradeDetector,
// UpgradeDetector: // UpgradeDetector:
void OnRelaunchNotificationPeriodPrefChanged() override; void OnRelaunchNotificationPeriodPrefChanged() override;
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) #if defined(OS_WIN)
// Receives the results of AreAutoupdatesEnabled and starts the upgrade check // Receives the results of AreAutoupdatesEnabled and starts the upgrade check
// timer. // timer.
void OnAutoupdatesEnabledResult(bool auto_updates_enabled); void OnAutoupdatesEnabledResult(bool auto_updates_enabled);
......
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