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 "ui/views/corewm/window_modality_controller.h" | 5 #include "ui/views/corewm/window_modality_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/capture_client.h" | 10 #include "ui/aura/client/capture_client.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 //////////////////////////////////////////////////////////////////////////////// | 103 //////////////////////////////////////////////////////////////////////////////// |
104 // WindowModalityController, aura::EventFilter implementation: | 104 // WindowModalityController, aura::EventFilter implementation: |
105 | 105 |
106 void WindowModalityController::OnKeyEvent(ui::KeyEvent* event) { | 106 void WindowModalityController::OnKeyEvent(ui::KeyEvent* event) { |
107 aura::Window* target = static_cast<aura::Window*>(event->target()); | 107 aura::Window* target = static_cast<aura::Window*>(event->target()); |
108 if (GetModalTransient(target)) | 108 if (GetModalTransient(target)) |
109 event->StopPropagation(); | 109 event->StopPropagation(); |
110 } | 110 } |
111 | 111 |
112 ui::EventResult WindowModalityController::OnMouseEvent(ui::MouseEvent* event) { | 112 void WindowModalityController::OnMouseEvent(ui::MouseEvent* event) { |
113 aura::Window* target = static_cast<aura::Window*>(event->target()); | 113 aura::Window* target = static_cast<aura::Window*>(event->target()); |
114 return ProcessLocatedEvent(target, event) ? ui::ER_CONSUMED : | 114 if (ProcessLocatedEvent(target, event)) |
115 ui::ER_UNHANDLED; | 115 event->StopPropagation(); |
116 } | 116 } |
117 | 117 |
118 void WindowModalityController::OnTouchEvent(ui::TouchEvent* event) { | 118 void WindowModalityController::OnTouchEvent(ui::TouchEvent* event) { |
119 aura::Window* target = static_cast<aura::Window*>(event->target()); | 119 aura::Window* target = static_cast<aura::Window*>(event->target()); |
120 if (ProcessLocatedEvent(target, event)) | 120 if (ProcessLocatedEvent(target, event)) |
121 event->StopPropagation(); | 121 event->StopPropagation(); |
122 } | 122 } |
123 | 123 |
124 //////////////////////////////////////////////////////////////////////////////// | 124 //////////////////////////////////////////////////////////////////////////////// |
125 // WindowModalityController, aura::EnvObserver implementation: | 125 // WindowModalityController, aura::EnvObserver implementation: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 aura::Window* modal_transient_child = GetModalTransient(target); | 167 aura::Window* modal_transient_child = GetModalTransient(target); |
168 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || | 168 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || |
169 event->type() == ui::ET_TOUCH_PRESSED)) { | 169 event->type() == ui::ET_TOUCH_PRESSED)) { |
170 AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); | 170 AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); |
171 } | 171 } |
172 return !!modal_transient_child; | 172 return !!modal_transient_child; |
173 } | 173 } |
174 | 174 |
175 } // namespace corewm | 175 } // namespace corewm |
176 } // namespace views | 176 } // namespace views |
OLD | NEW |