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/wm/gestures/tray_gesture_handler.h" | 5 #include "ash/wm/gestures/tray_gesture_handler.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "ash/system/tray/system_tray_bubble.h" | 9 #include "ash/system/tray/system_tray_bubble.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
11 #include "ui/compositor/layer.h" | 11 #include "ui/compositor/layer.h" |
12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
13 #include "ui/gfx/transform.h" | 13 #include "ui/gfx/transform.h" |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 | 15 |
16 const int kMinBubbleHeight = 13; | 16 const int kMinBubbleHeight = 13; |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 namespace internal { | |
20 | 19 |
21 TrayGestureHandler::TrayGestureHandler() | 20 TrayGestureHandler::TrayGestureHandler() |
22 : widget_(NULL), | 21 : widget_(NULL), |
23 gesture_drag_amount_(0) { | 22 gesture_drag_amount_(0) { |
24 // TODO(oshima): Support multiple display case. | 23 // TODO(oshima): Support multiple display case. |
25 SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray(); | 24 SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray(); |
26 tray->ShowDefaultView(BUBBLE_CREATE_NEW); | 25 tray->ShowDefaultView(BUBBLE_CREATE_NEW); |
27 SystemTrayBubble* bubble = tray->GetSystemBubble(); | 26 SystemTrayBubble* bubble = tray->GetSystemBubble(); |
28 if (!bubble) | 27 if (!bubble) |
29 return; | 28 return; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (bubble) | 97 if (bubble) |
99 bubble->bubble_view()->set_gesture_dragging(false); | 98 bubble->bubble_view()->set_gesture_dragging(false); |
100 } | 99 } |
101 } | 100 } |
102 | 101 |
103 void TrayGestureHandler::OnWidgetDestroying(views::Widget* widget) { | 102 void TrayGestureHandler::OnWidgetDestroying(views::Widget* widget) { |
104 CHECK_EQ(widget_, widget); | 103 CHECK_EQ(widget_, widget); |
105 widget_ = NULL; | 104 widget_ = NULL; |
106 } | 105 } |
107 | 106 |
108 } // namespace internal | |
109 } // namespace ash | 107 } // namespace ash |
OLD | NEW |