From e79d9d0e06b825d2e62b38db03248c0e6ceec7e4 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Sat, 5 Oct 2019 03:47:05 +0000 Subject: [PATCH] Only detect outdated builds on Google Chrome. Prior to https://crrev.com/643864, they weren't detected for Chromium on account of the way google_brand worked. That CL changed behavior and accidentally started showing the outdated build bubble for Linux Chromium users. BUG=1010592 Change-Id: I069ac36166e2ae720d58b1b9aa85605792be8684 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841635 Reviewed-by: Thomas Anderson Reviewed-by: Lei Zhang Commit-Queue: Greg Thompson Cr-Commit-Position: refs/heads/master@{#703131} --- .../upgrade_detector/upgrade_detector_impl.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc index 432e3789eced0..07850fdf80cd7 100644 --- a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc +++ b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc @@ -31,6 +31,7 @@ #include "base/time/default_tick_clock.h" #include "base/time/tick_clock.h" #include "base/time/time.h" +#include "build/branding_buildflags.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/google/google_brand.h" #include "chrome/common/chrome_switches.h" @@ -73,6 +74,14 @@ constexpr base::TimeDelta kNotifyCycleTimeForTesting = // The number of days after which we identify a build/install as outdated. constexpr base::TimeDelta kOutdatedBuildAge = base::TimeDelta::FromDays(12 * 7); +constexpr bool ShouldDetectOutdatedBuilds() { +#if BUILDFLAG(GOOGLE_CHROME_BRANDING) + return true; +#else // BUILDFLAG(GOOGLE_CHROME_BRANDING) + return false; +#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) +} + // Return the string that was passed as a value for the // kCheckForUpdateIntervalSec switch. std::string CmdLineInterval() { @@ -406,6 +415,10 @@ bool UpgradeDetectorImpl::DetectOutdated return false; } #endif + + if (!ShouldDetectOutdatedBuilds()) + return false; + } base::Time network_time;