Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: ui/aura/root_window_unittest.cc

Issue 10912063: events: Get rid of GestureStatus in favour of EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/aura/shared/compound_event_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/aura/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/aura/client/event_client.h" 10 #include "ui/aura/client/event_client.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 virtual bool PreHandleMouseEvent(Window* target, 101 virtual bool PreHandleMouseEvent(Window* target,
102 ui::MouseEvent* event) OVERRIDE { 102 ui::MouseEvent* event) OVERRIDE {
103 num_mouse_events_++; 103 num_mouse_events_++;
104 return true; 104 return true;
105 } 105 }
106 virtual ui::TouchStatus PreHandleTouchEvent( 106 virtual ui::TouchStatus PreHandleTouchEvent(
107 Window* target, ui::TouchEvent* event) OVERRIDE { 107 Window* target, ui::TouchEvent* event) OVERRIDE {
108 num_touch_events_++; 108 num_touch_events_++;
109 return ui::TOUCH_STATUS_UNKNOWN; 109 return ui::TOUCH_STATUS_UNKNOWN;
110 } 110 }
111 virtual ui::GestureStatus PreHandleGestureEvent( 111 virtual ui::EventResult PreHandleGestureEvent(
112 Window* target, ui::GestureEvent* event) OVERRIDE { 112 Window* target, ui::GestureEvent* event) OVERRIDE {
113 return ui::GESTURE_STATUS_UNKNOWN; 113 return ui::ER_UNHANDLED;
114 } 114 }
115 115
116 private: 116 private:
117 // How many key events have been received? 117 // How many key events have been received?
118 int num_key_events_; 118 int num_key_events_;
119 119
120 // How many mouse events have been received? 120 // How many mouse events have been received?
121 int num_mouse_events_; 121 int num_mouse_events_;
122 122
123 int num_touch_events_; 123 int num_touch_events_;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 ui::MouseEvent* event) OVERRIDE { 453 ui::MouseEvent* event) OVERRIDE {
454 events_.push_back(event->type()); 454 events_.push_back(event->type());
455 return true; 455 return true;
456 } 456 }
457 virtual ui::TouchStatus PreHandleTouchEvent( 457 virtual ui::TouchStatus PreHandleTouchEvent(
458 Window* target, 458 Window* target,
459 ui::TouchEvent* event) OVERRIDE { 459 ui::TouchEvent* event) OVERRIDE {
460 events_.push_back(event->type()); 460 events_.push_back(event->type());
461 return ui::TOUCH_STATUS_UNKNOWN; 461 return ui::TOUCH_STATUS_UNKNOWN;
462 } 462 }
463 virtual ui::GestureStatus PreHandleGestureEvent( 463 virtual ui::EventResult PreHandleGestureEvent(
464 Window* target, 464 Window* target,
465 ui::GestureEvent* event) OVERRIDE { 465 ui::GestureEvent* event) OVERRIDE {
466 events_.push_back(event->type()); 466 events_.push_back(event->type());
467 return ui::GESTURE_STATUS_UNKNOWN; 467 return ui::ER_UNHANDLED;
468 } 468 }
469 469
470 private: 470 private:
471 Events events_; 471 Events events_;
472 472
473 DISALLOW_COPY_AND_ASSIGN(EventFilterRecorder); 473 DISALLOW_COPY_AND_ASSIGN(EventFilterRecorder);
474 }; 474 };
475 475
476 // Converts an EventType to a string. 476 // Converts an EventType to a string.
477 std::string EventTypeToString(ui::EventType type) { 477 std::string EventTypeToString(ui::EventType type) {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 // handle steps from applying. 735 // handle steps from applying.
736 w11 = CreateWindow(11, w1.get(), d11); 736 w11 = CreateWindow(11, w1.get(), d11);
737 w1_filter->Reset(true); 737 w1_filter->Reset(true);
738 d11->Reset(w11, false); 738 d11->Reset(w11, false);
739 generator.PressLeftButton(); 739 generator.PressLeftButton();
740 EXPECT_FALSE(tracker.Contains(w11)); 740 EXPECT_FALSE(tracker.Contains(w11));
741 EXPECT_FALSE(d11->got_event()); 741 EXPECT_FALSE(d11->got_event());
742 } 742 }
743 743
744 } // namespace aura 744 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/aura/shared/compound_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698