Commit 1a463bdf authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

cbuiv: remove SessionCrashedBubbleView anchor rect

There's no anchor rect any more, and the only implementation of it
uses an empty gfx::Rect() for the anchor.

Bug: 1064663
Change-Id: I2e0ec895d46f84ce5472fa3220548d4e39fd4545
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2140035Reviewed-by: default avatarCollin Baker <collinbaker@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757165}
parent fb90db55
...@@ -77,19 +77,6 @@ bool DoesSupportConsentCheck() { ...@@ -77,19 +77,6 @@ bool DoesSupportConsentCheck() {
#endif #endif
} }
// Returns the app menu view, except when the browser window is Cocoa; Cocoa
// browser windows always have a null anchor view and use
// GetSessionCrashedBubbleAnchorRect() instead.
views::View* GetSessionCrashedBubbleAnchorView(Browser* browser) {
return BrowserView::GetBrowserViewForBrowser(browser)
->toolbar_button_provider()
->GetAppMenuButton();
}
gfx::Rect GetSessionCrashedBubbleAnchorRect(Browser* browser) {
return gfx::Rect();
}
} // namespace } // namespace
// A helper class that listens to browser removal event. // A helper class that listens to browser removal event.
...@@ -158,9 +145,11 @@ void SessionCrashedBubbleView::Show( ...@@ -158,9 +145,11 @@ void SessionCrashedBubbleView::Show(
return; return;
} }
SessionCrashedBubbleView* crash_bubble = new SessionCrashedBubbleView( views::View* anchor_view = BrowserView::GetBrowserViewForBrowser(browser)
GetSessionCrashedBubbleAnchorView(browser), ->toolbar_button_provider()
GetSessionCrashedBubbleAnchorRect(browser), browser, offer_uma_optin); ->GetAppMenuButton();
SessionCrashedBubbleView* crash_bubble =
new SessionCrashedBubbleView(anchor_view, browser, offer_uma_optin);
views::BubbleDialogDelegateView::CreateBubble(crash_bubble)->Show(); views::BubbleDialogDelegateView::CreateBubble(crash_bubble)->Show();
RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_SHOWN); RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_SHOWN);
...@@ -173,7 +162,6 @@ ax::mojom::Role SessionCrashedBubbleView::GetAccessibleWindowRole() { ...@@ -173,7 +162,6 @@ ax::mojom::Role SessionCrashedBubbleView::GetAccessibleWindowRole() {
} }
SessionCrashedBubbleView::SessionCrashedBubbleView(views::View* anchor_view, SessionCrashedBubbleView::SessionCrashedBubbleView(views::View* anchor_view,
const gfx::Rect& anchor_rect,
Browser* browser, Browser* browser,
bool offer_uma_optin) bool offer_uma_optin)
: BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT),
...@@ -181,6 +169,8 @@ SessionCrashedBubbleView::SessionCrashedBubbleView(views::View* anchor_view, ...@@ -181,6 +169,8 @@ SessionCrashedBubbleView::SessionCrashedBubbleView(views::View* anchor_view,
uma_option_(NULL), uma_option_(NULL),
offer_uma_optin_(offer_uma_optin), offer_uma_optin_(offer_uma_optin),
ignored_(true) { ignored_(true) {
DCHECK(anchor_view);
const SessionStartupPref session_startup_pref = const SessionStartupPref session_startup_pref =
SessionStartupPref::GetStartupPref(browser_->profile()); SessionStartupPref::GetStartupPref(browser_->profile());
// Offer the option to open the startup pages using the cancel button, but // Offer the option to open the startup pages using the cancel button, but
...@@ -205,12 +195,6 @@ SessionCrashedBubbleView::SessionCrashedBubbleView(views::View* anchor_view, ...@@ -205,12 +195,6 @@ SessionCrashedBubbleView::SessionCrashedBubbleView(views::View* anchor_view,
set_close_on_deactivate(false); set_close_on_deactivate(false);
chrome::RecordDialogCreation(chrome::DialogIdentifier::SESSION_CRASHED); chrome::RecordDialogCreation(chrome::DialogIdentifier::SESSION_CRASHED);
if (!anchor_view) {
SetAnchorRect(anchor_rect);
set_parent_window(
platform_util::GetViewForWindow(browser->window()->GetNativeWindow()));
}
} }
SessionCrashedBubbleView::~SessionCrashedBubbleView() { SessionCrashedBubbleView::~SessionCrashedBubbleView() {
......
...@@ -43,7 +43,6 @@ class SessionCrashedBubbleView : public SessionCrashedBubble, ...@@ -43,7 +43,6 @@ class SessionCrashedBubbleView : public SessionCrashedBubble,
friend class SessionCrashedBubbleViewTest; friend class SessionCrashedBubbleViewTest;
SessionCrashedBubbleView(views::View* anchor_view, SessionCrashedBubbleView(views::View* anchor_view,
const gfx::Rect& anchor_rect,
Browser* browser, Browser* browser,
bool offer_uma_optin); bool offer_uma_optin);
~SessionCrashedBubbleView() override; ~SessionCrashedBubbleView() override;
......
...@@ -31,9 +31,8 @@ class SessionCrashedBubbleViewTest : public DialogBrowserTest { ...@@ -31,9 +31,8 @@ class SessionCrashedBubbleViewTest : public DialogBrowserTest {
->toolbar_button_provider() ->toolbar_button_provider()
->GetAppMenuButton(); ->GetAppMenuButton();
} }
crash_bubble_ = crash_bubble_ = new SessionCrashedBubbleView(
new SessionCrashedBubbleView(anchor_view, anchor_rect, browser(), anchor_view, browser(), name == "SessionCrashedBubbleOfferUma");
name == "SessionCrashedBubbleOfferUma");
views::BubbleDialogDelegateView::CreateBubble(crash_bubble_)->Show(); views::BubbleDialogDelegateView::CreateBubble(crash_bubble_)->Show();
} }
......
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