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

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

Issue 2092473002: Convert TrayBubbleView to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@traybubblewrapper
Patch Set: review feedback Created 4 years, 6 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/tray_bubble_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/tray_bubble_view.cc
diff --git a/ui/views/bubble/tray_bubble_view.cc b/ui/views/bubble/tray_bubble_view.cc
index 0303ea5c1f855f7002e3ccc1dc6737633de21695..876c6c28dbee983349809365ec92e78c48e0656e 100644
--- a/ui/views/bubble/tray_bubble_view.cc
+++ b/ui/views/bubble/tray_bubble_view.cc
@@ -293,10 +293,10 @@ TrayBubbleView::InitParams::InitParams(AnchorType anchor_type,
TrayBubbleView::InitParams::InitParams(const InitParams& other) = default;
// static
-TrayBubbleView* TrayBubbleView::Create(gfx::NativeView parent_window,
- View* anchor,
+TrayBubbleView* TrayBubbleView::Create(View* anchor,
Delegate* delegate,
InitParams* init_params) {
+ DCHECK(anchor);
// Set arrow here so that it can be passed to the BubbleView constructor.
if (init_params->anchor_type == ANCHOR_TYPE_TRAY) {
if (init_params->anchor_alignment == ANCHOR_ALIGNMENT_BOTTOM) {
@@ -313,11 +313,10 @@ TrayBubbleView* TrayBubbleView::Create(gfx::NativeView parent_window,
init_params->arrow = BubbleBorder::NONE;
}
- return new TrayBubbleView(parent_window, anchor, delegate, *init_params);
+ return new TrayBubbleView(anchor, delegate, *init_params);
}
-TrayBubbleView::TrayBubbleView(gfx::NativeView parent_window,
- View* anchor,
+TrayBubbleView::TrayBubbleView(View* anchor,
Delegate* delegate,
const InitParams& init_params)
: BubbleDialogDelegateView(anchor, init_params.arrow),
@@ -328,7 +327,7 @@ TrayBubbleView::TrayBubbleView(gfx::NativeView parent_window,
owned_bubble_border_(bubble_border_),
is_gesture_dragging_(false),
mouse_actively_entered_(false) {
- set_parent_window(parent_window);
+ DCHECK(anchor_widget()); // Computed by BubbleDialogDelegateView().
set_notify_enter_exit_on_child(true);
set_close_on_deactivate(init_params.close_on_deactivate);
set_margins(gfx::Insets());
@@ -409,6 +408,12 @@ gfx::Rect TrayBubbleView::GetAnchorRect() const {
params_.anchor_alignment);
}
+void TrayBubbleView::OnBeforeBubbleWidgetInit(Widget::InitParams* params,
+ Widget* bubble_widget) const {
+ if (delegate_)
+ delegate_->OnBeforeBubbleWidgetInit(anchor_widget(), bubble_widget, params);
+}
+
bool TrayBubbleView::CanActivate() const {
return params_.can_activate;
}
« no previous file with comments | « ui/views/bubble/tray_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698