Commit de322468 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Gave some Mac/Views helper functions unique names

In jumbo experiments (jumbo is not yet supported in
chrome/browser/ui) several GetBubbleAnchorView and
GetBubbleAnchorRect functions clashed. They were more or less
identical but there is no obvious place to share them, and even
though they are small, the code gets messier if you inline them.

This patch gives the functions unique names as a preparation
for jumbo support in chrome/browser/ui

Bug: 803406
Change-Id: I104ae7cc961dd867e89e06fe8f18b401b39af549
Reviewed-on: https://chromium-review.googlesource.com/998158Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#548778}
parent caa4f985
......@@ -47,7 +47,7 @@ const int kMaxBubbleViewWidth = 362;
#if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER)
views::View* GetBubbleAnchorView(Browser* browser) {
views::View* GetGlobalErrorBubbleAnchorView(Browser* browser) {
#if BUILDFLAG(MAC_VIEWS_BROWSER)
if (views_mode_controller::IsViewsBrowserCocoa())
return nullptr;
......@@ -56,7 +56,7 @@ views::View* GetBubbleAnchorView(Browser* browser) {
return browser_view->button_provider()->GetAppMenuButton();
}
gfx::Rect GetBubbleAnchorRect(Browser* browser) {
gfx::Rect GetGlobalErrorBubbleAnchorRect(Browser* browser) {
#if BUILDFLAG(MAC_VIEWS_BROWSER)
if (views_mode_controller::IsViewsBrowserCocoa())
return bubble_anchor_util::GetAppMenuAnchorRectCocoa(browser);
......@@ -75,10 +75,10 @@ gfx::Rect GetBubbleAnchorRect(Browser* browser) {
GlobalErrorBubbleViewBase* GlobalErrorBubbleViewBase::ShowStandardBubbleView(
Browser* browser,
const base::WeakPtr<GlobalErrorWithStandardBubble>& error) {
views::View* anchor_view = GetBubbleAnchorView(browser);
views::View* anchor_view = GetGlobalErrorBubbleAnchorView(browser);
gfx::Rect anchor_rect;
if (!anchor_view)
anchor_rect = GetBubbleAnchorRect(browser);
anchor_rect = GetGlobalErrorBubbleAnchorRect(browser);
GlobalErrorBubbleView* bubble_view = new GlobalErrorBubbleView(
anchor_view, anchor_rect, views::BubbleBorder::TOP_RIGHT, browser, error);
views::BubbleDialogDelegateView::CreateBubble(bubble_view);
......
......@@ -85,9 +85,9 @@ bool DoesSupportConsentCheck() {
#if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER)
// Returns the app menu view, except when the browser window is Cocoa; Cocoa
// browser windows always have a null anchor view and use GetBubbleAnchorRect()
// instead.
views::View* GetBubbleAnchorView(Browser* browser) {
// browser windows always have a null anchor view and use
// GetSessionCrashedBubbleAnchorRect() instead.
views::View* GetSessionCrashedBubbleAnchorView(Browser* browser) {
#if BUILDFLAG(MAC_VIEWS_BROWSER)
if (views_mode_controller::IsViewsBrowserCocoa())
return nullptr;
......@@ -97,12 +97,12 @@ views::View* GetBubbleAnchorView(Browser* browser) {
->GetAppMenuButton();
}
#else // OS_MACOSX && !MAC_VIEWS_BROWSER
views::View* GetBubbleAnchorView(Browser* browser) {
views::View* GetSessionCrashedBubbleAnchorView(Browser* browser) {
return nullptr;
}
#endif
gfx::Rect GetBubbleAnchorRect(Browser* browser) {
gfx::Rect GetSessionCrashedBubbleAnchorRect(Browser* browser) {
#if BUILDFLAG(MAC_VIEWS_BROWSER)
if (views_mode_controller::IsViewsBrowserCocoa())
return bubble_anchor_util::GetAppMenuAnchorRectCocoa(browser);
......@@ -187,8 +187,8 @@ void SessionCrashedBubbleView::ShowForReal(
}
SessionCrashedBubbleView* crash_bubble = new SessionCrashedBubbleView(
GetBubbleAnchorView(browser), GetBubbleAnchorRect(browser), browser,
offer_uma_optin);
GetSessionCrashedBubbleAnchorView(browser),
GetSessionCrashedBubbleAnchorRect(browser), browser, offer_uma_optin);
views::BubbleDialogDelegateView::CreateBubble(crash_bubble)->Show();
#if defined(OS_MACOSX)
if (views_mode_controller::IsViewsBrowserCocoa())
......
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