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

Side by Side Diff: ash/system/tray/tray_bubble_wrapper.cc

Issue 1949823002: WIP: Eliminate event.target() usage from TrayEventFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: container delegate Created 4 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 unified diff | Download patch
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | ash/system/tray/tray_event_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/tray/tray_bubble_wrapper.h" 5 #include "ash/system/tray/tray_bubble_wrapper.h"
6 6
7 #include "ash/system/tray/tray_background_view.h" 7 #include "ash/system/tray/tray_background_view.h"
8 #include "ash/system/tray/tray_event_filter.h" 8 #include "ash/system/tray/tray_event_filter.h"
9 #include "ash/wm/window_properties.h" 9 #include "ash/wm/window_properties.h"
10 #include "ui/aura/client/capture_client.h" 10 #include "ui/aura/client/capture_client.h"
11 #include "ui/aura/window.h" 11 #include "ui/aura/window.h"
12 #include "ui/aura/window_event_dispatcher.h" 12 #include "ui/aura/window_event_dispatcher.h"
13 #include "ui/views/bubble/tray_bubble_view.h" 13 #include "ui/views/bubble/tray_bubble_view.h"
14 #include "ui/views/widget/widget.h" 14 #include "ui/views/widget/widget.h"
15 15
16 #include "base/debug/stack_trace.h"
17
16 namespace ash { 18 namespace ash {
17 19
18 TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray, 20 TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray,
19 views::TrayBubbleView* bubble_view) 21 views::TrayBubbleView* bubble_view)
20 : tray_(tray), 22 : tray_(tray),
21 bubble_view_(bubble_view) { 23 bubble_view_(bubble_view) {
22 bubble_widget_ = views::BubbleDialogDelegateView::CreateBubble(bubble_view_); 24 bubble_widget_ = views::BubbleDialogDelegateView::CreateBubble(bubble_view_);
23 bubble_widget_->AddObserver(this); 25 bubble_widget_->AddObserver(this);
24 26
27 // base::debug::StackTrace().Print();
28
25 TrayBackgroundView::InitializeBubbleAnimations(bubble_widget_); 29 TrayBackgroundView::InitializeBubbleAnimations(bubble_widget_);
26 tray_->UpdateBubbleViewArrow(bubble_view_); 30 tray_->UpdateBubbleViewArrow(bubble_view_);
27 bubble_view_->InitializeAndShowBubble(); 31 bubble_view_->InitializeAndShowBubble();
28 32
29 tray->tray_event_filter()->AddWrapper(this); 33 tray->tray_event_filter()->AddWrapper(this);
30 } 34 }
31 35
32 TrayBubbleWrapper::~TrayBubbleWrapper() { 36 TrayBubbleWrapper::~TrayBubbleWrapper() {
33 tray_->tray_event_filter()->RemoveWrapper(this); 37 tray_->tray_event_filter()->RemoveWrapper(this);
34 if (bubble_widget_) { 38 if (bubble_widget_) {
(...skipping 18 matching lines...) Expand all
53 tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_| 57 tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_|
54 } 58 }
55 59
56 void TrayBubbleWrapper::OnWidgetBoundsChanged(views::Widget* widget, 60 void TrayBubbleWrapper::OnWidgetBoundsChanged(views::Widget* widget,
57 const gfx::Rect& new_bounds) { 61 const gfx::Rect& new_bounds) {
58 DCHECK_EQ(bubble_widget_, widget); 62 DCHECK_EQ(bubble_widget_, widget);
59 tray_->BubbleResized(bubble_view_); 63 tray_->BubbleResized(bubble_view_);
60 } 64 }
61 65
62 } // namespace ash 66 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | ash/system/tray/tray_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698