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

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

Issue 2901273003: chromeos: Remove TrayBubbleView::Delegate::OnBeforeBubbleWidgetInit (Closed)
Patch Set: cleanup 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
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 d4d786268d096eecc51d6d1b96f397a3f49b9dc7..4f04167060ceeb97ee2cfe483d665646d8142e9b 100644
--- a/ui/views/bubble/tray_bubble_view.cc
+++ b/ui/views/bubble/tray_bubble_view.cc
@@ -183,14 +183,8 @@ TrayBubbleView::InitParams::InitParams(AnchorAlignment anchor_alignment,
TrayBubbleView::InitParams::InitParams(const InitParams& other) = default;
-// static
-TrayBubbleView* TrayBubbleView::Create(View* anchor,
- Delegate* delegate,
- InitParams* init_params) {
- return new TrayBubbleView(anchor, delegate, *init_params);
-}
-
-TrayBubbleView::TrayBubbleView(View* anchor,
+TrayBubbleView::TrayBubbleView(gfx::NativeWindow parent_window,
msw 2017/05/24 18:04:38 q: Should this be passed in as init_params.parent?
James Cook 2017/05/24 18:27:04 I considered that, but decided to keep InitParams
msw 2017/05/24 18:48:36 I think it's a bit odd to have two parent params;
+ View* anchor,
Delegate* delegate,
const InitParams& init_params)
: BubbleDialogDelegateView(anchor,
@@ -206,11 +200,13 @@ TrayBubbleView::TrayBubbleView(View* anchor,
owned_bubble_border_(bubble_border_),
is_gesture_dragging_(false),
mouse_actively_entered_(false) {
+ DCHECK(parent_window);
+ DCHECK(anchor_widget()); // Computed by BubbleDialogDelegateView().
bubble_border_->set_use_theme_background_color(!init_params.bg_color);
bubble_border_->set_alignment(BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
bubble_border_->set_paint_arrow(BubbleBorder::PAINT_NONE);
+ set_parent_window(parent_window);
set_can_activate(params_.can_activate);
- 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());
@@ -283,8 +279,6 @@ int TrayBubbleView::GetDialogButtons() const {
void TrayBubbleView::OnBeforeBubbleWidgetInit(Widget::InitParams* params,
Widget* bubble_widget) const {
- if (delegate_)
- delegate_->OnBeforeBubbleWidgetInit(anchor_widget(), bubble_widget, params);
// Apply a WM-provided shadow (see ui/wm/core/).
params->shadow_type = Widget::InitParams::SHADOW_TYPE_DROP;
params->shadow_elevation = wm::ShadowElevation::LARGE;
« ui/views/bubble/bubble_dialog_delegate.h ('K') | « 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