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

Unified Diff: ui/views/bubble/tray_bubble_view.h

Issue 2901273003: chromeos: Remove TrayBubbleView::Delegate::OnBeforeBubbleWidgetInit (Closed)
Patch Set: nit Created 3 years, 7 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 | « ui/views/bubble/bubble_dialog_delegate.h ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/tray_bubble_view.h
diff --git a/ui/views/bubble/tray_bubble_view.h b/ui/views/bubble/tray_bubble_view.h
index ccd7b77a0a3f2ea52aa6009815b20b364f96b713..81042a839e1dc55c79d2e3b6af1f2fc76cb62a4b 100644
--- a/ui/views/bubble/tray_bubble_view.h
+++ b/ui/views/bubble/tray_bubble_view.h
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/optional.h"
+#include "ui/gfx/native_widget_types.h"
#include "ui/views/bubble/bubble_dialog_delegate.h"
#include "ui/views/mouse_watcher.h"
#include "ui/views/views_export.h"
@@ -61,15 +62,6 @@ class VIEWS_EXPORT TrayBubbleView : public BubbleDialogDelegateView,
// accessible name for the bubble.
virtual base::string16 GetAccessibleNameForBubble() = 0;
- // Called before Widget::Init() on |bubble_widget|. Allows |params| to be
- // modified.
- // TODO(jamescook): Eliminate this method. It was introduced to let mash set
- // the widget container back when mash could not use aura::Window. Now the
- // anchor view should be sufficient.
- virtual void OnBeforeBubbleWidgetInit(Widget* anchor_widget,
- Widget* bubble_widget,
- Widget::InitParams* params) const = 0;
-
// Called when a bubble wants to hide/destroy itself (e.g. last visible
// child view was closed).
virtual void HideBubble(const TrayBubbleView* bubble_view) = 0;
@@ -79,23 +71,22 @@ class VIEWS_EXPORT TrayBubbleView : public BubbleDialogDelegateView,
};
struct VIEWS_EXPORT InitParams {
- InitParams(AnchorAlignment anchor_alignment, int min_width, int max_width);
+ InitParams();
InitParams(const InitParams& other);
- AnchorAlignment anchor_alignment;
- int min_width;
- int max_width;
- int max_height;
- bool can_activate;
- bool close_on_deactivate;
+ Delegate* delegate = nullptr;
+ gfx::NativeWindow parent_window = nullptr;
+ View* anchor_view = nullptr;
+ AnchorAlignment anchor_alignment = ANCHOR_ALIGNMENT_BOTTOM;
+ int min_width = 0;
+ int max_width = 0;
+ int max_height = 0;
+ bool can_activate = false;
+ bool close_on_deactivate = true;
// If not provided, the bg color will be derived from the NativeTheme.
base::Optional<SkColor> bg_color;
};
- // Constructs and returns a TrayBubbleView. |init_params| may be modified.
- static TrayBubbleView* Create(views::View* anchor,
- Delegate* delegate,
- InitParams* init_params);
-
+ explicit TrayBubbleView(const InitParams& init_params);
~TrayBubbleView() override;
// Returns whether a tray bubble is active.
@@ -152,10 +143,6 @@ class VIEWS_EXPORT TrayBubbleView : public BubbleDialogDelegateView,
void MouseMovedOutOfHost() override;
protected:
- TrayBubbleView(views::View* anchor,
- Delegate* delegate,
- const InitParams& init_params);
-
// Overridden from views::BubbleDialogDelegateView.
int GetDialogButtons() const override;
« no previous file with comments | « ui/views/bubble/bubble_dialog_delegate.h ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698