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/workspace/workspace_event_handler.h" | 5 #include "ash/wm/workspace/workspace_event_handler.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/wm/property_util.h" | 9 #include "ash/wm/property_util.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 multi_window_resize_controller_.Hide(); | 99 multi_window_resize_controller_.Hide(); |
100 HandleVerticalResizeDoubleClick(target, event); | 100 HandleVerticalResizeDoubleClick(target, event); |
101 break; | 101 break; |
102 } | 102 } |
103 default: | 103 default: |
104 break; | 104 break; |
105 } | 105 } |
106 return ToplevelWindowEventHandler::OnMouseEvent(event); | 106 return ToplevelWindowEventHandler::OnMouseEvent(event); |
107 } | 107 } |
108 | 108 |
109 ui::EventResult WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { | 109 void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { |
110 aura::Window* target = static_cast<aura::Window*>(event->target()); | 110 aura::Window* target = static_cast<aura::Window*>(event->target()); |
111 if (event->type() == ui::ET_GESTURE_DOUBLE_TAP && | 111 if (event->type() == ui::ET_GESTURE_DOUBLE_TAP && |
112 target->delegate()->GetNonClientComponent(event->location()) == | 112 target->delegate()->GetNonClientComponent(event->location()) == |
113 HTCAPTION) { | 113 HTCAPTION) { |
114 ToggleMaximizedState(target); // |this| may be destroyed from here. | 114 ToggleMaximizedState(target); // |this| may be destroyed from here. |
115 return ui::ER_CONSUMED; | 115 event->StopPropagation(); |
| 116 return; |
116 } | 117 } |
117 return ToplevelWindowEventHandler::OnGestureEvent(event); | 118 ToplevelWindowEventHandler::OnGestureEvent(event); |
118 } | 119 } |
119 | 120 |
120 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( | 121 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( |
121 aura::Window* target, | 122 aura::Window* target, |
122 ui::MouseEvent* event) { | 123 ui::MouseEvent* event) { |
123 gfx::Rect max_size(target->delegate()->GetMaximumSize()); | 124 gfx::Rect max_size(target->delegate()->GetMaximumSize()); |
124 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && | 125 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && |
125 !wm::IsWindowMaximized(target)) { | 126 !wm::IsWindowMaximized(target)) { |
126 int component = | 127 int component = |
127 target->delegate()->GetNonClientComponent(event->location()); | 128 target->delegate()->GetNonClientComponent(event->location()); |
(...skipping 30 matching lines...) Expand all Loading... |
158 target->bounds().y(), | 159 target->bounds().y(), |
159 work_area.width(), | 160 work_area.width(), |
160 target->bounds().height())); | 161 target->bounds().height())); |
161 } | 162 } |
162 } | 163 } |
163 } | 164 } |
164 } | 165 } |
165 | 166 |
166 } // namespace internal | 167 } // namespace internal |
167 } // namespace ash | 168 } // namespace ash |
OLD | NEW |