Pass new skip_tab_checking parameter to ShowIfNotOffTheRecordProfile()

Chromium change:

https://source.chromium.org/chromium/chromium/src/+/5510e6db4216bdc0b911021b1c6e924f6fe655a4

commit 5510e6db4216bdc0b911021b1c6e924f6fe655a4
Author: Nancy Wang <nancylingwang@chromium.org>
Date:   Thu Aug 12 18:17:42 2021 +0000

    Open the browser with the crash bubble after reboot from crash.

    When the full restore feature is enabled, if the system startsup from
    crash, the full restore notification is shown. If the user doesn't
    response the full restore notification, but launch the browser, the
    browser session can't be restored because 'HasPendingUncleanExit':
    https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/sessions/session_service.cc;l=104.

    This CL modified the session service to show the crash bubble for the
    first time open the browser, if the user doesn't response the full
    restore notification:
    1. If the browser is null, call StartupBrowserCreator to create a new
    browser instance.
    2. If the browser is not null, show the crash bubble in the current
    browser instance.

    BUG=1146900
This commit is contained in:
Mario Sanchez Prada
2021-09-13 14:53:39 -04:00
committed by mkarolin
parent 87ba3e9cbb
commit ca93397eda
4 changed files with 11 additions and 6 deletions
+4 -2
View File
@@ -8,7 +8,9 @@
#include "chrome/browser/ui/session_crashed_bubble.h"
// static
void SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave(Browser* browser) {
void SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave(
Browser* browser,
bool skip_tab_checking) {
// If crash report permission ask dialog is launched, tab restore bubble will
// be shown after closing aks dialog.
if (ShouldShowCrashReportPermissionAskDialog()) {
@@ -16,5 +18,5 @@ void SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave(Browser* browser) {
return;
}
ShowIfNotOffTheRecordProfile(browser);
ShowIfNotOffTheRecordProfile(browser, skip_tab_checking);
}
@@ -19,7 +19,8 @@ class CrashReportPermissionAskDialogTest : public DialogBrowserTest {
// TestBrowserUi:
void ShowUi(const std::string& name) override {
SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave(browser());
SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave(
browser(), /*skip_tab_checking=*/false);
}
};
@@ -46,7 +46,8 @@ void ScheduleSessionCrashedBubble() {
// It's ok to use lastly used browser because there will be only one when
// this launched after un-cleaned exit.
if (auto* browser = BrowserList::GetInstance()->GetLastActive())
SessionCrashedBubble::ShowIfNotOffTheRecordProfile(browser);
SessionCrashedBubble::ShowIfNotOffTheRecordProfile(
browser, /*skip_tab_checking=*/false);
}
gfx::FontList GetFont(int font_size, gfx::Font::Weight weight) {
@@ -6,8 +6,9 @@
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_SESSION_CRASHED_BUBBLE_H_
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_SESSION_CRASHED_BUBBLE_H_
#define ShowIfNotOffTheRecordProfile \
ShowIfNotOffTheRecordProfileBrave(Browser* browser); \
#define ShowIfNotOffTheRecordProfile \
ShowIfNotOffTheRecordProfileBrave(Browser* browser, \
bool skip_tab_checking); \
static void ShowIfNotOffTheRecordProfile
#include "../../../../../chrome/browser/ui/session_crashed_bubble.h"