Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: chrome/browser/ui/views/global_error_bubble_view.cc

Issue 2586373003: MacViews: Allow toolkit-views for "Global Error" bubbles. (Closed)
Patch Set: addObserverForName Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/global_error_bubble_view.cc
diff --git a/chrome/browser/ui/views/global_error_bubble_view.cc b/chrome/browser/ui/views/global_error_bubble_view.cc
index db0ed5a040f08def5461f76e8ad65ec5ff5bdb28..62789d901a1a452384093144da1d94ce2f126c3a 100644
--- a/chrome/browser/ui/views/global_error_bubble_view.cc
+++ b/chrome/browser/ui/views/global_error_bubble_view.cc
@@ -14,10 +14,10 @@
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/elevation_icon_setter.h"
-#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/app_menu_button.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_features.h"
#include "ui/gfx/image/image.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/blue_button.h"
@@ -28,6 +28,10 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/window/dialog_client_view.h"
+#if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER)
+#include "chrome/browser/ui/views/frame/browser_view.h"
+#endif
+
namespace {
const int kMaxBubbleViewWidth = 362;
@@ -36,29 +40,36 @@ const int kMaxBubbleViewWidth = 362;
// GlobalErrorBubbleViewBase ---------------------------------------------------
+#if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER)
// static
GlobalErrorBubbleViewBase* GlobalErrorBubbleViewBase::ShowStandardBubbleView(
Browser* browser,
const base::WeakPtr<GlobalErrorWithStandardBubble>& error) {
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
views::View* app_menu_button = browser_view->toolbar()->app_menu_button();
- GlobalErrorBubbleView* bubble_view = new GlobalErrorBubbleView(
- app_menu_button, views::BubbleBorder::TOP_RIGHT, browser, error);
+ GlobalErrorBubbleView* bubble_view =
+ new GlobalErrorBubbleView(app_menu_button, gfx::Point(),
+ views::BubbleBorder::TOP_RIGHT, browser, error);
views::BubbleDialogDelegateView::CreateBubble(bubble_view);
bubble_view->GetWidget()->Show();
return bubble_view;
}
+#endif // !OS_MACOSX || MAC_VIEWS_BROWSER
// GlobalErrorBubbleView -------------------------------------------------------
GlobalErrorBubbleView::GlobalErrorBubbleView(
views::View* anchor_view,
+ const gfx::Point& anchor_point,
views::BubbleBorder::Arrow arrow,
Browser* browser,
const base::WeakPtr<GlobalErrorWithStandardBubble>& error)
: BubbleDialogDelegateView(anchor_view, arrow),
browser_(browser),
- error_(error) {}
+ error_(error) {
+ if (!anchor_view)
+ SetAnchorRect(gfx::Rect(anchor_point, gfx::Size()));
+}
GlobalErrorBubbleView::~GlobalErrorBubbleView() {}
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698