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

Side by Side Diff: ui/aura/test/test_window_delegate.h

Issue 11570012: events: Update key-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-for-landing Created 8 years 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/test/test_event_handler.cc ('k') | ui/aura/test/test_window_delegate.cc » ('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 #ifndef UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ 5 #ifndef UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_
6 #define UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ 6 #define UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // A simple WindowDelegate implementation for these tests. It owns itself 71 // A simple WindowDelegate implementation for these tests. It owns itself
72 // (deletes itself when the Window it is attached to is destroyed). 72 // (deletes itself when the Window it is attached to is destroyed).
73 class ColorTestWindowDelegate : public TestWindowDelegate { 73 class ColorTestWindowDelegate : public TestWindowDelegate {
74 public: 74 public:
75 explicit ColorTestWindowDelegate(SkColor color); 75 explicit ColorTestWindowDelegate(SkColor color);
76 virtual ~ColorTestWindowDelegate(); 76 virtual ~ColorTestWindowDelegate();
77 77
78 ui::KeyboardCode last_key_code() const { return last_key_code_; } 78 ui::KeyboardCode last_key_code() const { return last_key_code_; }
79 79
80 // Overridden from TestWindowDelegate: 80 // Overridden from TestWindowDelegate:
81 virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; 81 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
82 virtual void OnWindowDestroyed() OVERRIDE; 82 virtual void OnWindowDestroyed() OVERRIDE;
83 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 83 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
84 84
85 private: 85 private:
86 SkColor color_; 86 SkColor color_;
87 ui::KeyboardCode last_key_code_; 87 ui::KeyboardCode last_key_code_;
88 88
89 DISALLOW_COPY_AND_ASSIGN(ColorTestWindowDelegate); 89 DISALLOW_COPY_AND_ASSIGN(ColorTestWindowDelegate);
90 }; 90 };
91 91
(...skipping 11 matching lines...) Expand all
103 103
104 DISALLOW_COPY_AND_ASSIGN(MaskedWindowDelegate); 104 DISALLOW_COPY_AND_ASSIGN(MaskedWindowDelegate);
105 }; 105 };
106 106
107 // Keeps track of mouse/key events. 107 // Keeps track of mouse/key events.
108 class EventCountDelegate : public TestWindowDelegate { 108 class EventCountDelegate : public TestWindowDelegate {
109 public: 109 public:
110 EventCountDelegate(); 110 EventCountDelegate();
111 111
112 // Overridden from TestWindowDelegate: 112 // Overridden from TestWindowDelegate:
113 virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; 113 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
114 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; 114 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
115 115
116 // Returns the counts of mouse motion events in the 116 // Returns the counts of mouse motion events in the
117 // form of "<enter> <move> <leave>". 117 // form of "<enter> <move> <leave>".
118 std::string GetMouseMotionCountsAndReset(); 118 std::string GetMouseMotionCountsAndReset();
119 119
120 // Returns the counts of mouse button events in the 120 // Returns the counts of mouse button events in the
121 // form of "<press> <release>". 121 // form of "<press> <release>".
122 std::string GetMouseButtonCountsAndReset(); 122 std::string GetMouseButtonCountsAndReset();
123 123
(...skipping 10 matching lines...) Expand all
134 int key_press_count_; 134 int key_press_count_;
135 int key_release_count_; 135 int key_release_count_;
136 136
137 DISALLOW_COPY_AND_ASSIGN(EventCountDelegate); 137 DISALLOW_COPY_AND_ASSIGN(EventCountDelegate);
138 }; 138 };
139 139
140 } // namespace test 140 } // namespace test
141 } // namespace aura 141 } // namespace aura
142 142
143 #endif // UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ 143 #endif // UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/aura/test/test_event_handler.cc ('k') | ui/aura/test/test_window_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698