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/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 | 210 |
211 void clear_got_gesture_event() { | 211 void clear_got_gesture_event() { |
212 got_gesture_event_ = false; | 212 got_gesture_event_ = false; |
213 } | 213 } |
214 bool got_gesture_event() const { | 214 bool got_gesture_event() const { |
215 return got_gesture_event_; | 215 return got_gesture_event_; |
216 } | 216 } |
217 | 217 |
218 // View overrides: | 218 // View overrides: |
219 virtual ui::EventResult OnGestureEvent(ui::GestureEvent* event) OVERRIDE { | 219 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { |
220 got_gesture_event_ = true; | 220 got_gesture_event_ = true; |
221 return consume_gesture_event_ ? ui::ER_CONSUMED : ui::ER_UNHANDLED; | 221 if (consume_gesture_event_) |
| 222 event->StopPropagation(); |
222 } | 223 } |
223 | 224 |
224 private: | 225 private: |
225 // Was OnGestureEvent() invoked? | 226 // Was OnGestureEvent() invoked? |
226 bool got_gesture_event_; | 227 bool got_gesture_event_; |
227 | 228 |
228 // Dictates what OnGestureEvent() returns. | 229 // Dictates what OnGestureEvent() returns. |
229 bool consume_gesture_event_; | 230 bool consume_gesture_event_; |
230 | 231 |
231 DISALLOW_COPY_AND_ASSIGN(GestureTrackingView); | 232 DISALLOW_COPY_AND_ASSIGN(GestureTrackingView); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 parent->GetNativeWindow()->GetEventHandlerForPoint( | 366 parent->GetNativeWindow()->GetEventHandlerForPoint( |
366 gfx::Point(20, 20))); | 367 gfx::Point(20, 20))); |
367 | 368 |
368 // Work around for bug in NativeWidgetAura. | 369 // Work around for bug in NativeWidgetAura. |
369 // TODO: fix bug and remove this. | 370 // TODO: fix bug and remove this. |
370 parent->Close(); | 371 parent->Close(); |
371 } | 372 } |
372 | 373 |
373 } // namespace | 374 } // namespace |
374 } // namespace views | 375 } // namespace views |
OLD | NEW |