Commit 7fd55fee authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Disable upgrade detector if a Guest window is open.

Current Guest profiles are OffTheRecord and upgrade detection is
disabled when an OTR session is running. But ephemeral Guest profiles
are not OTR and hence not covered.

An extra check for existence of Guest profiles to disable upgrade is
added.

Please see go/ephemeral-guest-profiles for more context.

Bug: 1125474
Change-Id: I1a14f7222bab47ea8385f03e262d2982b53ab749
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505750
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822065}
parent 13fe006d
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/time/tick_clock.h" #include "base/time/tick_clock.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_otr_state.h" #include "chrome/browser/ui/browser_otr_state.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
...@@ -207,10 +208,13 @@ void UpgradeDetector::TriggerCriticalUpdate() { ...@@ -207,10 +208,13 @@ void UpgradeDetector::TriggerCriticalUpdate() {
void UpgradeDetector::CheckIdle() { void UpgradeDetector::CheckIdle() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Don't proceed while an off-the-record window is open. The timer will still // Don't proceed while an off-the-record or Guest window is open. The timer
// keep firing, so this function will get a chance to re-evaluate this. // will still keep firing, so this function will get a chance to re-evaluate
if (chrome::IsOffTheRecordSessionActive()) // this.
if (chrome::IsOffTheRecordSessionActive() ||
BrowserList::GetGuestBrowserCount()) {
return; return;
}
// CalculateIdleState expects an interval in seconds. // CalculateIdleState expects an interval in seconds.
int idle_time_allowed = int idle_time_allowed =
......
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