Add session restore infobar setting change pref and metrics [chromium/src : main]

0 views
Skip to first unread message

Muhammad Salmaan (Gerrit)

unread,
Sep 22, 2025, 4:10:25 PM (3 days ago) Sep 22
to Darryl James, Daniel Soromou, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Daniel Soromou and Darryl James

Muhammad Salmaan added 1 comment

File tools/metrics/histograms/metadata/session/histograms.xml
Line 114, Patchset 2:<histogram name="Session.Restore.SettingChanged.TurnOffFromRestart"
enum="Boolean" expires_after="2026-09-01">
<owner>musa...@chromium.org</owner>
<owner>koreta...@chromium.org</owner>
<summary>
Records whether the user changed the session restore setting after being
shown an infobar to turn off session restore from browser restart.
</summary>
</histogram>

<histogram name="Session.Restore.SettingChanged.TurnOffFromSession"
enum="Boolean" expires_after="2026-09-01">
<owner>musa...@chromium.org</owner>
<owner>koreta...@chromium.org</owner>
<summary>
Records whether the user changed the session restore setting after being
shown an infobar to turn off session restore from a restored session.
</summary>
</histogram>

<histogram name="Session.Restore.SettingChanged.TurnOnSessionRestore"
enum="Boolean" expires_after="2026-09-01">
<owner>musa...@chromium.org</owner>
<owner>koreta...@chromium.org</owner>
<summary>
Records whether the user changed the session restore setting after being
shown an infobar to turn on session restore.
</summary>
</histogram>
Daniel Soromou . resolved

We can merge those 3 metrics together in 1 by using Patterned Histograms.
See: https://chromium.googlesource.com/chromium/src/+/lkgr/tools/metrics/histograms/README.md

Muhammad Salmaan

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Soromou
  • Darryl James
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
Gerrit-Change-Number: 6968033
Gerrit-PatchSet: 6
Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Soromou <koreta...@chromium.org>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Attention: Daniel Soromou <koreta...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Sep 2025 20:10:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Soromou <koreta...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Soromou (Gerrit)

unread,
Sep 22, 2025, 4:13:40 PM (3 days ago) Sep 22
to Muhammad Salmaan, Darryl James, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Darryl James and Muhammad Salmaan

Daniel Soromou added 1 comment

File chrome/browser/ui/ui_features.h
Line 68, Patchset 6 (Latest):// When this param is true, the session restore preference will have
// continue where you left off as default behavior.
extern const base::FeatureParam<bool> kSetDefaultToContinueSession;
Daniel Soromou . unresolved

Should we use BASE_DECLARE_FEATURE_PARAM or should we document why it's not used here?

Open in Gerrit

Related details

Attention is currently required from:
  • Darryl James
  • Muhammad Salmaan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
Gerrit-Change-Number: 6968033
Gerrit-PatchSet: 6
Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Soromou <koreta...@chromium.org>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Sep 2025 20:13:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Muhammad Salmaan (Gerrit)

unread,
Sep 22, 2025, 4:17:43 PM (3 days ago) Sep 22
to Darryl James, Daniel Soromou, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Daniel Soromou and Darryl James

Muhammad Salmaan added 1 comment

File chrome/browser/ui/ui_features.h
Line 68, Patchset 6 (Latest):// When this param is true, the session restore preference will have
// continue where you left off as default behavior.
extern const base::FeatureParam<bool> kSetDefaultToContinueSession;
Daniel Soromou . resolved

Should we use BASE_DECLARE_FEATURE_PARAM or should we document why it's not used here?

Muhammad Salmaan

I discussed it with Ian that its better to have a mode that when its enabled it sets the session restore preference to restore session.Having two feature params could is not needed in this case.This would be similar to the page action when we individually set them to true. The same is happening here.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Soromou
  • Darryl James
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
Gerrit-Change-Number: 6968033
Gerrit-PatchSet: 6
Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Soromou <koreta...@chromium.org>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Attention: Daniel Soromou <koreta...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Sep 2025 20:17:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Soromou <koreta...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Soromou (Gerrit)

unread,
Sep 22, 2025, 4:22:19 PM (3 days ago) Sep 22
to Muhammad Salmaan, Darryl James, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Darryl James and Muhammad Salmaan

Daniel Soromou added 1 comment

File chrome/browser/ui/ui_features.h
Line 68, Patchset 6 (Latest):// When this param is true, the session restore preference will have
// continue where you left off as default behavior.
extern const base::FeatureParam<bool> kSetDefaultToContinueSession;
Daniel Soromou . unresolved

Should we use BASE_DECLARE_FEATURE_PARAM or should we document why it's not used here?

Muhammad Salmaan

I discussed it with Ian that its better to have a mode that when its enabled it sets the session restore preference to restore session.Having two feature params could is not needed in this case.This would be similar to the page action when we individually set them to true. The same is happening here.

Daniel Soromou

I am talking about they way to declare this. We have 2 ways to declare feature params to my knowledge.

(1) using BASE_DECLARE_FEATURE_PARAM: this is optimized for the case where the param will be queried multiple time. All the params in this file using that partern.

(2) using extern like it's done currently.


So my question was should we also use `BASE_DECLARE_FEATURE_PARAM` here like for the other feature params? or should be explain why we are not using that approach here?

Open in Gerrit

Related details

Attention is currently required from:
  • Darryl James
  • Muhammad Salmaan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
Gerrit-Change-Number: 6968033
Gerrit-PatchSet: 6
Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Soromou <koreta...@chromium.org>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Sep 2025 20:22:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Muhammad Salmaan <musa...@chromium.org>
Comment-In-Reply-To: Daniel Soromou <koreta...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Muhammad Salmaan (Gerrit)

unread,
Sep 22, 2025, 4:38:31 PM (3 days ago) Sep 22
to Darryl James, Daniel Soromou, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Daniel Soromou and Darryl James

Muhammad Salmaan added 1 comment

File chrome/browser/ui/ui_features.h
Line 68, Patchset 6:// When this param is true, the session restore preference will have

// continue where you left off as default behavior.
extern const base::FeatureParam<bool> kSetDefaultToContinueSession;
Daniel Soromou . resolved

Should we use BASE_DECLARE_FEATURE_PARAM or should we document why it's not used here?

Muhammad Salmaan

I discussed it with Ian that its better to have a mode that when its enabled it sets the session restore preference to restore session.Having two feature params could is not needed in this case.This would be similar to the page action when we individually set them to true. The same is happening here.

Daniel Soromou

I am talking about they way to declare this. We have 2 ways to declare feature params to my knowledge.

(1) using BASE_DECLARE_FEATURE_PARAM: this is optimized for the case where the param will be queried multiple time. All the params in this file using that partern.

(2) using extern like it's done currently.


So my question was should we also use `BASE_DECLARE_FEATURE_PARAM` here like for the other feature params? or should be explain why we are not using that approach here?

Muhammad Salmaan

Changed to using BASE_DECLARE_FEATURE_PARAM as others in the file are using it too.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Soromou
  • Darryl James
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
Gerrit-Change-Number: 6968033
Gerrit-PatchSet: 7
Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Soromou <koreta...@chromium.org>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Attention: Daniel Soromou <koreta...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Sep 2025 20:38:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Soromou <koreta...@chromium.org>
Comment-In-Reply-To: Muhammad Salmaan <musa...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Darryl James (Gerrit)

unread,
Sep 22, 2025, 5:14:34 PM (3 days ago) Sep 22
to Muhammad Salmaan, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Alex Ilin and Muhammad Salmaan

Darryl James added 2 comments

File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
Line 40, Patchset 7 (Latest): if (WasSessionRestorePrefChanged(profile.GetPrefs()) ||
Darryl James . unresolved

optional: This can probably have more generic naming such as `ManualUserActionTaken` or `UserInteractedWithSessionRestorePref`

How it is now is also good 👍

Line 78, Patchset 7 (Latest): pref_change_registrar_.RemoveAll();
Darryl James . unresolved

Should this code be implemented within the infobar itself?

My understanding is that this listener function can outlive the infobar itself. That is, once we have shown the infobar we listen to the kRestoreOnStartup pref and continue to listen to it throughout the lifetime of the browser until the pref is changed.

I am thinking we want to tie this to the lifetime of the infobar instead (either in the infobar itself of by listening to the infobar's destruction in this class).

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Ilin
  • Muhammad Salmaan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
Gerrit-Change-Number: 6968033
Gerrit-PatchSet: 7
Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Alex Ilin <alex...@chromium.org>
Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Sep 2025 21:14:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Muhammad Salmaan (Gerrit)

unread,
Sep 22, 2025, 6:54:35 PM (3 days ago) Sep 22
to Alex Ilin, Darryl James, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Alex Ilin and Darryl James

Muhammad Salmaan added 2 comments

File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
Line 40, Patchset 7: if (WasSessionRestorePrefChanged(profile.GetPrefs()) ||
Darryl James . resolved

optional: This can probably have more generic naming such as `ManualUserActionTaken` or `UserInteractedWithSessionRestorePref`

How it is now is also good 👍

Muhammad Salmaan

Done

Line 78, Patchset 7: pref_change_registrar_.RemoveAll();
Darryl James . resolved

Should this code be implemented within the infobar itself?

My understanding is that this listener function can outlive the infobar itself. That is, once we have shown the infobar we listen to the kRestoreOnStartup pref and continue to listen to it throughout the lifetime of the browser until the pref is changed.

I am thinking we want to tie this to the lifetime of the infobar instead (either in the infobar itself of by listening to the infobar's destruction in this class).

Muhammad Salmaan

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Ilin
  • Darryl James
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
Gerrit-Change-Number: 6968033
Gerrit-PatchSet: 8
Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Alex Ilin <alex...@chromium.org>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Sep 2025 22:54:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Darryl James <dlj...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Muhammad Salmaan (Gerrit)

unread,
Sep 23, 2025, 11:45:48 AM (2 days ago) Sep 23
to Alex Ilin, Darryl James, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Alex Ilin and Darryl James

Muhammad Salmaan added 1 comment

File chrome/browser/ui/browser_window/internal/browser_window_features.cc
Line 359, Patchset 2: session_restore_infobar_controller_ = std::make_unique<
session_restore_infobar::SessionRestoreInfobarController>();
Daniel Soromou . resolved

Consider making this Unowned User Data

Muhammad Salmaan

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Ilin
  • Darryl James
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
Gerrit-Change-Number: 6968033
Gerrit-PatchSet: 9
Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Alex Ilin <alex...@chromium.org>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Sep 2025 15:45:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Soromou <koreta...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Darryl James (Gerrit)

unread,
Sep 23, 2025, 12:43:04 PM (2 days ago) Sep 23
to Muhammad Salmaan, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Alex Ilin and Muhammad Salmaan

Darryl James voted and added 4 comments

Votes added by Darryl James

Code-Review+1

4 comments

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Darryl James . resolved

lgtm % a few small comments; Thanks!

File chrome/browser/ui/startup/infobar_utils.cc
Line 236, Patchset 9 (Latest): auto session_restore_infobar_controller =
Darryl James . unresolved

`auto*` to prevent compiler warnings

File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
Line 34, Patchset 9 (Latest):void SessionRestoreInfobarController::MaybeShowInfoBar(
Profile& profile,
bool was_restarted,
bool is_post_crash_launch) {
if (features::kSetDefaultToContinueSession.Get()) {
SessionStartupPref::SetStartupPref(
&profile, SessionStartupPref(SessionStartupPref::LAST));
}

if (UserInteractedWithSessionRestorePref(profile.GetPrefs()) ||
InfoBarShownMaxTimes(profile.GetPrefs())) {
return;
}
model_ = std::make_unique<SessionRestoreInfobarModel>(profile, was_restarted,
is_post_crash_launch);
if (!model_->ShouldShowOnStartup()) {
return;
}
if (GetInfobarMessageType() ==
SessionRestoreInfoBarDelegate::InfobarMessageType::kNone) {
return;
}

SessionRestoreInfoBarManager::GetInstance()->ShowInfoBar(
profile, GetInfobarMessageType());
IncrementInfoBarShownCount(profile.GetPrefs());
}
Darryl James . unresolved

super optional: This function should go below the destructor to match the definition order in the header file 👍

File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.h
Line 85, Patchset 9 (Latest): static void RecordSettingChanged(
Darryl James . unresolved

question: Why is this one static? It is to get around errors for a callback or something similar?

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Ilin
  • Muhammad Salmaan
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
    Gerrit-Change-Number: 6968033
    Gerrit-PatchSet: 9
    Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-Attention: Alex Ilin <alex...@chromium.org>
    Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Sep 2025 16:42:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Ilin (Gerrit)

    unread,
    Sep 23, 2025, 1:12:13 PM (2 days ago) Sep 23
    to Muhammad Salmaan, Darryl James, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
    Attention needed from Muhammad Salmaan

    Alex Ilin added 3 comments

    File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.cc
    Line 101, Patchset 9 (Latest): bool setting_changed,
    Alex Ilin . unresolved

    I don't see it ever being recorded with `false` value. Is this working as intended?

    File tools/metrics/histograms/metadata/session/histograms.xml
    Line 119, Patchset 9 (Latest): Records whether the user changed the session restore setting after being
    shown an infobar of type {SessionRestoreInfobarType}.
    Alex Ilin . unresolved

    The description needs to be more clear about what "after being shown an infobar" means. Will this be recorded if the user changes the setting 5 minutes after seeing the infobar? 10 days after seeing the infobar?

    I guess this wants to say "changed the session restore setting while being shown an infobar".

    Line 120, Patchset 9 (Latest): shown an infobar of type {SessionRestoreInfobarType}.
    Alex Ilin . unresolved

    The UMA dashboard will replace the `{SessionRestoreInfobarType}` placeholder with the summary provided below, so you'll get the following string:

    ```


    Records whether the user changed the session restore setting after being

    shown an infobar of type turn off session restore from browser restart.
    ```

    This string is a little bit hard to read.

    I have the following suggestion that should be combined with a slight change of "summary" strings.

    ```suggestion
    shown the session restore infobar that informs the user about {SessionRestoreInfobarType}.
    ```
    ```
    <token key="SessionRestoreInfobarType">
    <variant name="TurnOffFromRestart"
    summary="turning off session restore from browser restart"/>
    <variant name="TurnOffFromSession"
    summary="turning off session restore from a restored session"/>
    <variant name="TurnOnSessionRestore" summary="turning on session restore"/>
    </token>
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Muhammad Salmaan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
    Gerrit-Change-Number: 6968033
    Gerrit-PatchSet: 9
    Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Sep 2025 17:11:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Muhammad Salmaan (Gerrit)

    unread,
    Sep 23, 2025, 2:24:36 PM (2 days ago) Sep 23
    to Darryl James, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
    Attention needed from Alex Ilin

    Muhammad Salmaan added 6 comments

    File chrome/browser/ui/startup/infobar_utils.cc
    Line 236, Patchset 9: auto session_restore_infobar_controller =
    Darryl James . resolved

    `auto*` to prevent compiler warnings

    Muhammad Salmaan

    Done

    File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
    Line 34, Patchset 9:void SessionRestoreInfobarController::MaybeShowInfoBar(

    Profile& profile,
    bool was_restarted,
    bool is_post_crash_launch) {
    if (features::kSetDefaultToContinueSession.Get()) {
    SessionStartupPref::SetStartupPref(
    &profile, SessionStartupPref(SessionStartupPref::LAST));
    }

    if (UserInteractedWithSessionRestorePref(profile.GetPrefs()) ||
    InfoBarShownMaxTimes(profile.GetPrefs())) {
    return;
    }
    model_ = std::make_unique<SessionRestoreInfobarModel>(profile, was_restarted,
    is_post_crash_launch);
    if (!model_->ShouldShowOnStartup()) {
    return;
    }
    if (GetInfobarMessageType() ==
    SessionRestoreInfoBarDelegate::InfobarMessageType::kNone) {
    return;
    }

    SessionRestoreInfoBarManager::GetInstance()->ShowInfoBar(
    profile, GetInfobarMessageType());
    IncrementInfoBarShownCount(profile.GetPrefs());
    }
    Darryl James . resolved

    super optional: This function should go below the destructor to match the definition order in the header file 👍

    Muhammad Salmaan

    Done

    File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.h
    Line 85, Patchset 9: static void RecordSettingChanged(
    Darryl James . resolved

    question: Why is this one static? It is to get around errors for a callback or something similar?

    Muhammad Salmaan

    Had reverted code, used in the controller for recording metrics for setting to false when user did not change the setting for the infobar when it was a maximum of 3 times and no action was taken.

    File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.cc
    Line 101, Patchset 9: bool setting_changed,
    Alex Ilin . resolved

    I don't see it ever being recorded with `false` value. Is this working as intended?

    Muhammad Salmaan

    Added it in, I reverted it by mistake.

    File tools/metrics/histograms/metadata/session/histograms.xml
    Line 119, Patchset 9: Records whether the user changed the session restore setting after being

    shown an infobar of type {SessionRestoreInfobarType}.
    Alex Ilin . resolved

    The description needs to be more clear about what "after being shown an infobar" means. Will this be recorded if the user changes the setting 5 minutes after seeing the infobar? 10 days after seeing the infobar?

    I guess this wants to say "changed the session restore setting while being shown an infobar".

    Muhammad Salmaan

    Done

    Line 120, Patchset 9: shown an infobar of type {SessionRestoreInfobarType}.
    Alex Ilin . resolved

    The UMA dashboard will replace the `{SessionRestoreInfobarType}` placeholder with the summary provided below, so you'll get the following string:

    ```
    Records whether the user changed the session restore setting after being
    shown an infobar of type turn off session restore from browser restart.
    ```

    This string is a little bit hard to read.

    I have the following suggestion that should be combined with a slight change of "summary" strings.

    ```suggestion
    shown the session restore infobar that informs the user about {SessionRestoreInfobarType}.
    ```
    ```
    <token key="SessionRestoreInfobarType">
    <variant name="TurnOffFromRestart"
    summary="turning off session restore from browser restart"/>
    <variant name="TurnOffFromSession"
    summary="turning off session restore from a restored session"/>
    <variant name="TurnOnSessionRestore" summary="turning on session restore"/>
    </token>
    ```
    Muhammad Salmaan

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Ilin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
    Gerrit-Change-Number: 6968033
    Gerrit-PatchSet: 10
    Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-Attention: Alex Ilin <alex...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Sep 2025 18:23:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alex Ilin <alex...@chromium.org>
    Comment-In-Reply-To: Darryl James <dlj...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Darryl James (Gerrit)

    unread,
    Sep 23, 2025, 3:38:58 PM (2 days ago) Sep 23
    to Muhammad Salmaan, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
    Attention needed from Alex Ilin and Muhammad Salmaan

    Darryl James voted and added 1 comment

    Votes added by Darryl James

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 11 (Latest):
    Darryl James . resolved

    lgtms

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Ilin
    • Muhammad Salmaan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
    Gerrit-Change-Number: 6968033
    Gerrit-PatchSet: 11
    Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-Attention: Alex Ilin <alex...@chromium.org>
    Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Sep 2025 19:38:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Ilin (Gerrit)

    unread,
    Sep 24, 2025, 4:29:20 AM (yesterday) Sep 24
    to Muhammad Salmaan, Darryl James, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
    Attention needed from Muhammad Salmaan

    Alex Ilin added 6 comments

    File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
    Line 54, Patchset 11 (Latest): SessionRestoreInfoBarDelegate::RecordSettingChanged(
    false, GetInfobarMessageType());
    Alex Ilin . unresolved

    It'd be better to record this histogram only once when the max allowed limit is hit. With the way it's written now, the histogram will be recorded on every startup [1] until the user changes the pref value to trigger an earlier return on L50.

    This will for sure over-inflate the `false` count, making the histogram less useful.

    [1] https://crsrc.org/c/chrome/browser/ui/startup/infobar_utils.cc;drc=ce651b75de646270fc28ce175bcc951842095309;l=236

    File tools/metrics/histograms/metadata/session/histograms.xml
    Line 120, Patchset 9: shown an infobar of type {SessionRestoreInfobarType}.
    Alex Ilin . resolved

    The UMA dashboard will replace the `{SessionRestoreInfobarType}` placeholder with the summary provided below, so you'll get the following string:

    ```
    Records whether the user changed the session restore setting after being
    shown an infobar of type turn off session restore from browser restart.
    ```

    This string is a little bit hard to read.

    I have the following suggestion that should be combined with a slight change of "summary" strings.

    ```suggestion
    shown the session restore infobar that informs the user about {SessionRestoreInfobarType}.
    ```
    ```
    <token key="SessionRestoreInfobarType">
    <variant name="TurnOffFromRestart"
    summary="turning off session restore from browser restart"/>
    <variant name="TurnOffFromSession"
    summary="turning off session restore from a restored session"/>
    <variant name="TurnOnSessionRestore" summary="turning on session restore"/>
    </token>
    ```
    Muhammad Salmaan

    Done

    Alex Ilin

    Only partially done, I highlighted below the required edits to the summary values.

    Line 119, Patchset 9: Records whether the user changed the session restore setting after being
    shown an infobar of type {SessionRestoreInfobarType}.
    Alex Ilin . unresolved

    The description needs to be more clear about what "after being shown an infobar" means. Will this be recorded if the user changes the setting 5 minutes after seeing the infobar? 10 days after seeing the infobar?

    I guess this wants to say "changed the session restore setting while being shown an infobar".

    Muhammad Salmaan

    Done

    Alex Ilin

    Not done, my comment still stands

    Please explain explain the recording logic in details as required by guidelines [1].

    Examining your logic, it's more subtle than my initial guess, especially for recording the `false` value.

    False value is recorded upon a blocked attempt to show the infobar because the max limit is reached.

    There is also a case, when the histogram isn't recorded at all. Namely, if the user changes the pref value while the infobar is not showing, neither `true` or `false` will be recorded (is this intentional?).

    It's important to document all these special cases so that you and other engineers can make sense of the recorded values later [2].

    [1] https://chromium.googlesource.com/chromium/src/+/HEAD/tools/metrics/histograms/README.md#state-when-it-is-recorded
    [2]
    https://chromium.googlesource.com/chromium/src/+/HEAD/tools/metrics/histograms/README.md#understandable-to-everyone

    Line 125, Patchset 11 (Latest): summary="turn off session restore from browser restart"/>
    Alex Ilin . unresolved
    ```suggestion

    summary="turning off session restore from browser restart"/>
    ```
    Line 127, Patchset 11 (Latest): summary="turn off session restore from a restored session"/>
    Alex Ilin . unresolved
    ```suggestion

    summary="turning off session restore from a restored session"/>
    ```
    Line 128, Patchset 11 (Latest): <variant name="TurnOnSessionRestore" summary="turn on session restore"/>
    Alex Ilin . unresolved
    ```suggestion

    <variant name="TurnOnSessionRestore" summary="turning on session restore"/>
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Muhammad Salmaan
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
      Gerrit-Change-Number: 6968033
      Gerrit-PatchSet: 11
      Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
      Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
      Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
      Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
      Gerrit-Comment-Date: Wed, 24 Sep 2025 08:29:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Alex Ilin <alex...@chromium.org>
      Comment-In-Reply-To: Muhammad Salmaan <musa...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Muhammad Salmaan (Gerrit)

      unread,
      Sep 24, 2025, 11:02:01 AM (yesterday) Sep 24
      to Darryl James, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
      Attention needed from Alex Ilin and Darryl James

      Muhammad Salmaan added 5 comments

      File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
      Line 54, Patchset 11: SessionRestoreInfoBarDelegate::RecordSettingChanged(
      false, GetInfobarMessageType());
      Alex Ilin . resolved

      It'd be better to record this histogram only once when the max allowed limit is hit. With the way it's written now, the histogram will be recorded on every startup [1] until the user changes the pref value to trigger an earlier return on L50.

      This will for sure over-inflate the `false` count, making the histogram less useful.

      [1] https://crsrc.org/c/chrome/browser/ui/startup/infobar_utils.cc;drc=ce651b75de646270fc28ce175bcc951842095309;l=236

      Muhammad Salmaan

      This will hit it only once when for the specific profile the infobar has been shown 3 times. So basically, the infobar will be shown 3 times and then on the fourth try this if statement will be true and record false for the setting change.

      File tools/metrics/histograms/metadata/session/histograms.xml
      Line 119, Patchset 9: Records whether the user changed the session restore setting after being
      shown an infobar of type {SessionRestoreInfobarType}.
      Alex Ilin . unresolved

      The description needs to be more clear about what "after being shown an infobar" means. Will this be recorded if the user changes the setting 5 minutes after seeing the infobar? 10 days after seeing the infobar?

      I guess this wants to say "changed the session restore setting while being shown an infobar".

      Muhammad Salmaan

      Done

      Alex Ilin

      Not done, my comment still stands

      Please explain explain the recording logic in details as required by guidelines [1].

      Examining your logic, it's more subtle than my initial guess, especially for recording the `false` value.

      False value is recorded upon a blocked attempt to show the infobar because the max limit is reached.

      There is also a case, when the histogram isn't recorded at all. Namely, if the user changes the pref value while the infobar is not showing, neither `true` or `false` will be recorded (is this intentional?).

      It's important to document all these special cases so that you and other engineers can make sense of the recorded values later [2].

      [1] https://chromium.googlesource.com/chromium/src/+/HEAD/tools/metrics/histograms/README.md#state-when-it-is-recorded
      [2]
      https://chromium.googlesource.com/chromium/src/+/HEAD/tools/metrics/histograms/README.md#understandable-to-everyone

      Muhammad Salmaan

      I have described it better, let me know if this one on the current change sounds good.

      Line 125, Patchset 11: summary="turn off session restore from browser restart"/>
      Alex Ilin . resolved
      ```suggestion
      summary="turning off session restore from browser restart"/>
      ```
      Muhammad Salmaan

      Done

      Line 127, Patchset 11: summary="turn off session restore from a restored session"/>
      Alex Ilin . resolved
      ```suggestion
      summary="turning off session restore from a restored session"/>
      ```
      Muhammad Salmaan

      Done

      Line 128, Patchset 11: <variant name="TurnOnSessionRestore" summary="turn on session restore"/>
      Alex Ilin . resolved
      ```suggestion
      <variant name="TurnOnSessionRestore" summary="turning on session restore"/>
      ```
      Muhammad Salmaan

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Ilin
      • Darryl James
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
        Gerrit-Change-Number: 6968033
        Gerrit-PatchSet: 14
        Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
        Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
        Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-Attention: Alex Ilin <alex...@chromium.org>
        Gerrit-Attention: Darryl James <dlj...@chromium.org>
        Gerrit-Comment-Date: Wed, 24 Sep 2025 15:01:52 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Alex Ilin (Gerrit)

        unread,
        Sep 24, 2025, 11:27:24 AM (yesterday) Sep 24
        to Muhammad Salmaan, Darryl James, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
        Attention needed from Darryl James and Muhammad Salmaan

        Alex Ilin added 3 comments

        File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
        Line 54, Patchset 11: SessionRestoreInfoBarDelegate::RecordSettingChanged(
        false, GetInfobarMessageType());
        Alex Ilin . unresolved

        It'd be better to record this histogram only once when the max allowed limit is hit. With the way it's written now, the histogram will be recorded on every startup [1] until the user changes the pref value to trigger an earlier return on L50.

        This will for sure over-inflate the `false` count, making the histogram less useful.

        [1] https://crsrc.org/c/chrome/browser/ui/startup/infobar_utils.cc;drc=ce651b75de646270fc28ce175bcc951842095309;l=236

        Muhammad Salmaan

        This will hit it only once when for the specific profile the infobar has been shown 3 times. So basically, the infobar will be shown 3 times and then on the fourth try this if statement will be true and record false for the setting change.

        Alex Ilin

        My concern is about what's going to happen when `MaybeShowInfoBar()` is called for the fifth time.

        Could you point me out at a condition that blocks this call for the 5th, 6th, and so on times?

        Even better, it'd be great to write a test verifying that a `false` value will be recorded only once.

        File tools/metrics/histograms/metadata/session/histograms.xml
        Line 119, Patchset 9: Records whether the user changed the session restore setting after being
        shown an infobar of type {SessionRestoreInfobarType}.
        Alex Ilin . resolved

        The description needs to be more clear about what "after being shown an infobar" means. Will this be recorded if the user changes the setting 5 minutes after seeing the infobar? 10 days after seeing the infobar?

        I guess this wants to say "changed the session restore setting while being shown an infobar".

        Muhammad Salmaan

        Done

        Alex Ilin

        Not done, my comment still stands

        Please explain explain the recording logic in details as required by guidelines [1].

        Examining your logic, it's more subtle than my initial guess, especially for recording the `false` value.

        False value is recorded upon a blocked attempt to show the infobar because the max limit is reached.

        There is also a case, when the histogram isn't recorded at all. Namely, if the user changes the pref value while the infobar is not showing, neither `true` or `false` will be recorded (is this intentional?).

        It's important to document all these special cases so that you and other engineers can make sense of the recorded values later [2].

        [1] https://chromium.googlesource.com/chromium/src/+/HEAD/tools/metrics/histograms/README.md#state-when-it-is-recorded
        [2]
        https://chromium.googlesource.com/chromium/src/+/HEAD/tools/metrics/histograms/README.md#understandable-to-everyone

        Muhammad Salmaan

        I have described it better, let me know if this one on the current change sounds good.

        Alex Ilin

        The extended version looks pretty good, thanks!

        Line 124, Patchset 14 (Latest): while the infobar is shown. A `false` value is recorded if the user
        dismisses the infobar without changing the setting, or the user has ignored
        the infobar and it has been shown a max of 3 times.
        Alex Ilin . unresolved

        Do we need both of these conditions? I liked the previous version more, when a single profile would record `true` or `false` at most once.

        This gave you a clear signal whether the infobar encouraged the user to take an action after 3 attempts, or not.

        If you want to record `false` on every infobar dismiss, I'd encourage you to split your histogram into two, or convert it to an enum histogram, so that you can distinguish an intermediate `false` from a final `false`.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Darryl James
        • Muhammad Salmaan
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
        Gerrit-Change-Number: 6968033
        Gerrit-PatchSet: 14
        Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
        Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
        Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-Attention: Darryl James <dlj...@chromium.org>
        Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-Comment-Date: Wed, 24 Sep 2025 15:27:08 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Muhammad Salmaan (Gerrit)

        unread,
        Sep 24, 2025, 1:31:48 PM (yesterday) Sep 24
        to Darryl James, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
        Attention needed from Alex Ilin and Darryl James

        Muhammad Salmaan added 2 comments

        File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
        Line 54, Patchset 11: SessionRestoreInfoBarDelegate::RecordSettingChanged(
        false, GetInfobarMessageType());
        Alex Ilin . unresolved

        It'd be better to record this histogram only once when the max allowed limit is hit. With the way it's written now, the histogram will be recorded on every startup [1] until the user changes the pref value to trigger an earlier return on L50.

        This will for sure over-inflate the `false` count, making the histogram less useful.

        [1] https://crsrc.org/c/chrome/browser/ui/startup/infobar_utils.cc;drc=ce651b75de646270fc28ce175bcc951842095309;l=236

        Muhammad Salmaan

        This will hit it only once when for the specific profile the infobar has been shown 3 times. So basically, the infobar will be shown 3 times and then on the fourth try this if statement will be true and record false for the setting change.

        Alex Ilin

        My concern is about what's going to happen when `MaybeShowInfoBar()` is called for the fifth time.

        Could you point me out at a condition that blocks this call for the 5th, 6th, and so on times?

        Even better, it'd be great to write a test verifying that a `false` value will be recorded only once.

        Muhammad Salmaan

        I added a check in the destructor for the delegate if no action is taken for the infobar and its the last time its being displayed to record the metric.

        File tools/metrics/histograms/metadata/session/histograms.xml
        Line 124, Patchset 14: while the infobar is shown. A `false` value is recorded if the user

        dismisses the infobar without changing the setting, or the user has ignored
        the infobar and it has been shown a max of 3 times.
        Alex Ilin . resolved

        Do we need both of these conditions? I liked the previous version more, when a single profile would record `true` or `false` at most once.

        This gave you a clear signal whether the infobar encouraged the user to take an action after 3 attempts, or not.

        If you want to record `false` on every infobar dismiss, I'd encourage you to split your histogram into two, or convert it to an enum histogram, so that you can distinguish an intermediate `false` from a final `false`.

        Muhammad Salmaan

        if a user dismisses an infobar once, it will not appear again. so the false is only ever recorded once for if the infobar was dismissed and the other flow in which it is recorded false is when the infobar has been ignored ( meaning no action was taken for the 3 times the infobar was shown.).For a profile, False is only recorded once).
        I added a check in the destructor for the delegate if no action is taken for the infobar and its the last time its being displayed to record the metric.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Ilin
        • Darryl James
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
        Gerrit-Change-Number: 6968033
        Gerrit-PatchSet: 15
        Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
        Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
        Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-Attention: Alex Ilin <alex...@chromium.org>
        Gerrit-Attention: Darryl James <dlj...@chromium.org>
        Gerrit-Comment-Date: Wed, 24 Sep 2025 17:31:42 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Muhammad Salmaan (Gerrit)

        unread,
        Sep 24, 2025, 1:33:50 PM (yesterday) Sep 24
        to Darryl James, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
        Attention needed from Alex Ilin and Darryl James

        Muhammad Salmaan added 1 comment

        File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
        Line 54, Patchset 11: SessionRestoreInfoBarDelegate::RecordSettingChanged(
        false, GetInfobarMessageType());
        Alex Ilin . resolved

        It'd be better to record this histogram only once when the max allowed limit is hit. With the way it's written now, the histogram will be recorded on every startup [1] until the user changes the pref value to trigger an earlier return on L50.

        This will for sure over-inflate the `false` count, making the histogram less useful.

        [1] https://crsrc.org/c/chrome/browser/ui/startup/infobar_utils.cc;drc=ce651b75de646270fc28ce175bcc951842095309;l=236

        Muhammad Salmaan

        This will hit it only once when for the specific profile the infobar has been shown 3 times. So basically, the infobar will be shown 3 times and then on the fourth try this if statement will be true and record false for the setting change.

        Alex Ilin

        My concern is about what's going to happen when `MaybeShowInfoBar()` is called for the fifth time.

        Could you point me out at a condition that blocks this call for the 5th, 6th, and so on times?

        Even better, it'd be great to write a test verifying that a `false` value will be recorded only once.

        Muhammad Salmaan

        I added a check in the destructor for the delegate if no action is taken for the infobar and its the last time its being displayed to record the metric.

        Muhammad Salmaan

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Ilin
        • Darryl James
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
        Gerrit-Change-Number: 6968033
        Gerrit-PatchSet: 15
        Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
        Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
        Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-Attention: Alex Ilin <alex...@chromium.org>
        Gerrit-Attention: Darryl James <dlj...@chromium.org>
        Gerrit-Comment-Date: Wed, 24 Sep 2025 17:33:40 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Darryl James (Gerrit)

        unread,
        Sep 24, 2025, 2:23:45 PM (yesterday) Sep 24
        to Muhammad Salmaan, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
        Attention needed from Alex Ilin and Muhammad Salmaan

        Darryl James added 2 comments

        File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
        Line 44, Patchset 15 (Latest): model_ = std::make_unique<SessionRestoreInfobarModel>(profile, was_restarted,
        Darryl James . unresolved

        question: Should model creation be deferred until after the early returns?

        File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.cc
        Line 185, Patchset 15 (Latest): profile_.get().GetPrefs()->SetBoolean(prefs::kSessionRestorePrefChanged,
        true);
        Darryl James . unresolved

        I was thinking about this line for a while, did we want the behavior to permanently dismiss the infobar if the user dismissed it once? Even if they haven't changed the session restore preference?

        My expectation here would be to allow users to dismiss the infobar manually up to 3 times when it appears. The only cases where the infobar would stop appearing is if the pref is manually changed by the user in the settings page, or if the infobar has already been seen 3 times.

        Dismissing it should just increment the count in my opinion but maybe this is intended? Is it?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Ilin
        • Muhammad Salmaan
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
          Gerrit-Change-Number: 6968033
          Gerrit-PatchSet: 15
          Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
          Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
          Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
          Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-Attention: Alex Ilin <alex...@chromium.org>
          Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
          Gerrit-Comment-Date: Wed, 24 Sep 2025 18:23:35 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Muhammad Salmaan (Gerrit)

          unread,
          Sep 24, 2025, 2:32:02 PM (yesterday) Sep 24
          to Darryl James, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
          Attention needed from Alex Ilin and Darryl James

          Muhammad Salmaan added 2 comments

          File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
          Line 44, Patchset 15: model_ = std::make_unique<SessionRestoreInfobarModel>(profile, was_restarted,
          Darryl James . resolved

          question: Should model creation be deferred until after the early returns?

          Muhammad Salmaan

          Fix applied.

          File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.cc
          Line 185, Patchset 15: profile_.get().GetPrefs()->SetBoolean(prefs::kSessionRestorePrefChanged,
          true);
          Darryl James . resolved

          I was thinking about this line for a while, did we want the behavior to permanently dismiss the infobar if the user dismissed it once? Even if they haven't changed the session restore preference?

          My expectation here would be to allow users to dismiss the infobar manually up to 3 times when it appears. The only cases where the infobar would stop appearing is if the pref is manually changed by the user in the settings page, or if the infobar has already been seen 3 times.

          Dismissing it should just increment the count in my opinion but maybe this is intended? Is it?

          Muhammad Salmaan

          It is the intended behaviour.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Ilin
          • Darryl James
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
          Gerrit-Change-Number: 6968033
          Gerrit-PatchSet: 16
          Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
          Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
          Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
          Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-Attention: Alex Ilin <alex...@chromium.org>
          Gerrit-Attention: Darryl James <dlj...@chromium.org>
          Gerrit-Comment-Date: Wed, 24 Sep 2025 18:31:57 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Darryl James <dlj...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Darryl James (Gerrit)

          unread,
          Sep 24, 2025, 2:33:14 PM (yesterday) Sep 24
          to Muhammad Salmaan, Alex Ilin, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
          Attention needed from Alex Ilin and Muhammad Salmaan

          Darryl James voted and added 1 comment

          Votes added by Darryl James

          Code-Review+1

          1 comment

          Patchset-level comments
          File-level comment, Patchset 16 (Latest):
          Darryl James . resolved

          lgtm!

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Ilin
          • Muhammad Salmaan
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
            Gerrit-Change-Number: 6968033
            Gerrit-PatchSet: 16
            Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
            Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
            Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-Attention: Alex Ilin <alex...@chromium.org>
            Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-Comment-Date: Wed, 24 Sep 2025 18:33:01 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Alex Ilin (Gerrit)

            unread,
            5:17 AM (15 hours ago) 5:17 AM
            to Muhammad Salmaan, Alex Ilin, Chrome Metrics Logs, Darryl James, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
            Attention needed from Muhammad Salmaan

            Alex Ilin voted and added 5 comments

            Votes added by Alex Ilin

            Code-Review+1

            5 comments

            Patchset-level comments
            Alex Ilin . resolved

            LGTM

            File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
            Line 54, Patchset 11: SessionRestoreInfoBarDelegate::RecordSettingChanged(
            false, GetInfobarMessageType());
            Alex Ilin . resolved

            It'd be better to record this histogram only once when the max allowed limit is hit. With the way it's written now, the histogram will be recorded on every startup [1] until the user changes the pref value to trigger an earlier return on L50.

            This will for sure over-inflate the `false` count, making the histogram less useful.

            [1] https://crsrc.org/c/chrome/browser/ui/startup/infobar_utils.cc;drc=ce651b75de646270fc28ce175bcc951842095309;l=236

            Muhammad Salmaan

            This will hit it only once when for the specific profile the infobar has been shown 3 times. So basically, the infobar will be shown 3 times and then on the fourth try this if statement will be true and record false for the setting change.

            Alex Ilin

            My concern is about what's going to happen when `MaybeShowInfoBar()` is called for the fifth time.

            Could you point me out at a condition that blocks this call for the 5th, 6th, and so on times?

            Even better, it'd be great to write a test verifying that a `false` value will be recorded only once.

            Muhammad Salmaan

            I added a check in the destructor for the delegate if no action is taken for the infobar and its the last time its being displayed to record the metric.

            Muhammad Salmaan

            Done

            Alex Ilin

            Thanks, I like this solution much better!

            File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.cc
            Line 90, Patchset 16 (Latest): prefs::kSessionRestoreInfoBarTimesShown) == 3) {
            Alex Ilin . unresolved

            nit: please use a named constant here
            1. A named constant makes the meaning of "3" clearer
            2. It avoids getting two values that mean the same thing diverged over time

            ```suggestion
            prefs::kSessionRestoreInfoBarTimesShown) ==
            kSessionRestoreInfoBarMaxTimesToShow) {
            ```
            File tools/metrics/histograms/metadata/session/histograms.xml
            Line 125, Patchset 16 (Latest): dismisses the infobar without changing the setting, or the user has ignored
            Alex Ilin . unresolved

            nit:

            ```suggestion
            dismisses the infobar without changing the setting (which stops the infobar from being shown again), or the user has ignored
            ```
            Line 124, Patchset 14: while the infobar is shown. A `false` value is recorded if the user
            dismisses the infobar without changing the setting, or the user has ignored
            the infobar and it has been shown a max of 3 times.
            Alex Ilin . resolved

            Do we need both of these conditions? I liked the previous version more, when a single profile would record `true` or `false` at most once.

            This gave you a clear signal whether the infobar encouraged the user to take an action after 3 attempts, or not.

            If you want to record `false` on every infobar dismiss, I'd encourage you to split your histogram into two, or convert it to an enum histogram, so that you can distinguish an intermediate `false` from a final `false`.

            Muhammad Salmaan

            if a user dismisses an infobar once, it will not appear again. so the false is only ever recorded once for if the infobar was dismissed and the other flow in which it is recorded false is when the infobar has been ignored ( meaning no action was taken for the 3 times the infobar was shown.).For a profile, False is only recorded once).

            I added a check in the destructor for the delegate if no action is taken for the infobar and its the last time its being displayed to record the metric.

            Alex Ilin

            Ah, that's a piece of information that was missing, thanks for clarifying!

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Muhammad Salmaan
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
            Gerrit-Change-Number: 6968033
            Gerrit-PatchSet: 16
            Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
            Gerrit-Reviewer: Chrome Metrics Logs <chrome-metrics...@google.com>
            Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
            Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-Attention: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-Comment-Date: Thu, 25 Sep 2025 09:16:54 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Muhammad Salmaan (Gerrit)

            unread,
            9:09 AM (11 hours ago) 9:09 AM
            to Alex Ilin, Chrome Metrics Logs, Darryl James, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org

            Muhammad Salmaan added 2 comments

            File chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.cc
            Line 90, Patchset 16: prefs::kSessionRestoreInfoBarTimesShown) == 3) {
            Alex Ilin . resolved

            nit: please use a named constant here
            1. A named constant makes the meaning of "3" clearer
            2. It avoids getting two values that mean the same thing diverged over time

            ```suggestion
            prefs::kSessionRestoreInfoBarTimesShown) ==
            kSessionRestoreInfoBarMaxTimesToShow) {
            ```
            Muhammad Salmaan

            Fix applied.

            File tools/metrics/histograms/metadata/session/histograms.xml
            Line 125, Patchset 16: dismisses the infobar without changing the setting, or the user has ignored
            Alex Ilin . resolved

            nit:

            ```suggestion
            dismisses the infobar without changing the setting (which stops the infobar from being shown again), or the user has ignored
            ```
            Muhammad Salmaan

            Fix applied.

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
            Gerrit-Change-Number: 6968033
            Gerrit-PatchSet: 17
            Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
            Gerrit-Reviewer: Chrome Metrics Logs <chrome-metrics...@google.com>
            Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
            Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-Comment-Date: Thu, 25 Sep 2025 13:09:29 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Alex Ilin <alex...@chromium.org>
            satisfied_requirement
            open
            diffy

            Muhammad Salmaan (Gerrit)

            unread,
            9:09 AM (11 hours ago) 9:09 AM
            to Alex Ilin, Chrome Metrics Logs, Darryl James, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org

            Muhammad Salmaan voted Commit-Queue+2

            Commit-Queue+2
            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
            Gerrit-Change-Number: 6968033
            Gerrit-PatchSet: 17
            Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
            Gerrit-Reviewer: Chrome Metrics Logs <chrome-metrics...@google.com>
            Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
            Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-Comment-Date: Thu, 25 Sep 2025 13:09:32 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Muhammad Salmaan (Gerrit)

            unread,
            12:02 PM (8 hours ago) 12:02 PM
            to Alex Ilin, Chrome Metrics Logs, Darryl James, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org

            Muhammad Salmaan voted Commit-Queue+2

            Commit-Queue+2
            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
            Gerrit-Change-Number: 6968033
            Gerrit-PatchSet: 18
            Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
            Gerrit-Reviewer: Chrome Metrics Logs <chrome-metrics...@google.com>
            Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
            Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-Comment-Date: Thu, 25 Sep 2025 16:02:01 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            12:06 PM (8 hours ago) 12:06 PM
            to Muhammad Salmaan, Alex Ilin, Chrome Metrics Logs, Darryl James, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org

            Chromium LUCI CQ submitted the change with unreviewed changes

            Unreviewed changes

            16 is the latest approved patch-set.
            The change was submitted with unreviewed changes in the following files:

            ```
            The name of the file: chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.cc
            Insertions: 2, Deletions: 1.

            @@ -87,7 +87,8 @@
            RecordInfoBarAction(message_type_,
            SessionRestoreInfoBarDelegate::InfobarAction::kIgnored);
            if (profile_->GetPrefs()->GetInteger(
            - prefs::kSessionRestoreInfoBarTimesShown) == 3) {
            + prefs::kSessionRestoreInfoBarTimesShown) ==
            + kSessionRestoreInfoBarMaxTimesToShow) {
            RecordSettingChanged(false, message_type_);
            }
            }
            ```
            ```
            The name of the file: tools/metrics/histograms/metadata/session/histograms.xml
            Insertions: 3, Deletions: 2.

            @@ -122,8 +122,9 @@

            A `true` value is recorded if the user changes the session restore setting

            while the infobar is shown. A `false` value is recorded if the user
            -    dismisses the infobar without changing the setting, or the user has ignored
            - the infobar and it has been shown a max of 3 times.
            + dismisses the infobar without changing the setting (which stops the infobar
            + from being shown again), or the user has ignored the infobar and it has been
            + shown a max of 3 times.

            This histogram is not recorded if the user changes the setting at any other
            time (i.e. when the session restore infobar is not showing).
            ```

            Change information

            Commit message:
            Add session restore infobar setting change pref and metrics

            This cl adds the following: Adds a mode to change the default session
            restore preference to continue where you left off. Adds a check to see
            while the infobar is displayed, if the setting has changed, and if it
            has, the infobar will not be displayed starting from the next browser
            session. Adds metric to record for if the user changed the session
            restore preference while the infobar was present and records the type of
            infobar present as well while the change took place.
            Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
            Commit-Queue: Muhammad Salmaan <musa...@chromium.org>
            Reviewed-by: Darryl James <dlj...@chromium.org>
            Reviewed-by: Alex Ilin <alex...@chromium.org>
            Cr-Commit-Position: refs/heads/main@{#1520653}
            Files:
            • M chrome/browser/ui/browser_ui_prefs.cc
            • M chrome/browser/ui/browser_window/internal/BUILD.gn
            • M chrome/browser/ui/browser_window/internal/browser_window_features.cc
            • M chrome/browser/ui/browser_window/public/browser_window_features.h
            • M chrome/browser/ui/startup/infobar_utils.cc
            • M chrome/browser/ui/ui_features.cc
            • M chrome/browser/ui/ui_features.h
            • M chrome/browser/ui/views/session_restore_infobar/BUILD.gn
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.cc
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_controller.h
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.cc
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate.h
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_delegate_unittest.cc
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_interactive_uitest.cc
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_manager.cc
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_model.cc
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_model.h
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_prefs.cc
            • M chrome/browser/ui/views/session_restore_infobar/session_restore_infobar_prefs.h
            • M chrome/common/pref_names.h
            • M tools/metrics/histograms/metadata/session/histograms.xml
            Change size: M
            Delta: 21 files changed, 214 insertions(+), 20 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Darryl James, +1 by Alex Ilin
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ieab335b5e8a1b180183275adb4e95822de0b8231
            Gerrit-Change-Number: 6968033
            Gerrit-PatchSet: 19
            Gerrit-Owner: Muhammad Salmaan <musa...@chromium.org>
            Gerrit-Reviewer: Alex Ilin <alex...@chromium.org>
            Gerrit-Reviewer: Chrome Metrics Logs <chrome-metrics...@google.com>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
            Gerrit-Reviewer: Muhammad Salmaan <musa...@chromium.org>
            open
            diffy
            satisfied_requirement
            Reply all
            Reply to author
            Forward
            0 new messages