OLD | NEW |
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 namespace ash { | 16 namespace ash { |
17 namespace internal { | |
18 | 17 |
19 TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray, | 18 TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray, |
20 views::TrayBubbleView* bubble_view) | 19 views::TrayBubbleView* bubble_view) |
21 : tray_(tray), | 20 : tray_(tray), |
22 bubble_view_(bubble_view) { | 21 bubble_view_(bubble_view) { |
23 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_); | 22 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_); |
24 bubble_widget_->AddObserver(this); | 23 bubble_widget_->AddObserver(this); |
25 | 24 |
26 tray_->InitializeBubbleAnimations(bubble_widget_); | 25 tray_->InitializeBubbleAnimations(bubble_widget_); |
27 tray_->UpdateBubbleViewArrow(bubble_view_); | 26 tray_->UpdateBubbleViewArrow(bubble_view_); |
(...skipping 25 matching lines...) Expand all Loading... |
53 capture_client->ReleaseCapture(tray_->GetWidget()->GetNativeView()); | 52 capture_client->ReleaseCapture(tray_->GetWidget()->GetNativeView()); |
54 tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_| | 53 tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_| |
55 } | 54 } |
56 | 55 |
57 void TrayBubbleWrapper::OnWidgetBoundsChanged(views::Widget* widget, | 56 void TrayBubbleWrapper::OnWidgetBoundsChanged(views::Widget* widget, |
58 const gfx::Rect& new_bounds) { | 57 const gfx::Rect& new_bounds) { |
59 DCHECK_EQ(bubble_widget_, widget); | 58 DCHECK_EQ(bubble_widget_, widget); |
60 tray_->BubbleResized(bubble_view_); | 59 tray_->BubbleResized(bubble_view_); |
61 } | 60 } |
62 | 61 |
63 } // namespace internal | |
64 } // namespace ash | 62 } // namespace ash |
OLD | NEW |