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

Side by Side Diff: ui/aura/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/window_delegate.cc ('k') | ui/base/events.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/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE { 168 virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
169 if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED) 169 if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED)
170 capture_changed_event_count_++; 170 capture_changed_event_count_++;
171 mouse_event_count_++; 171 mouse_event_count_++;
172 return false; 172 return false;
173 } 173 }
174 virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE { 174 virtual ui::TouchStatus OnTouchEvent(ui::TouchEvent* event) OVERRIDE {
175 touch_event_count_++; 175 touch_event_count_++;
176 return ui::TOUCH_STATUS_UNKNOWN; 176 return ui::TOUCH_STATUS_UNKNOWN;
177 } 177 }
178 virtual ui::GestureStatus OnGestureEvent( 178 virtual ui::EventResult OnGestureEvent(
179 ui::GestureEvent* event) OVERRIDE { 179 ui::GestureEvent* event) OVERRIDE {
180 gesture_event_count_++; 180 gesture_event_count_++;
181 return ui::GESTURE_STATUS_UNKNOWN; 181 return ui::ER_UNHANDLED;
182 } 182 }
183 virtual void OnCaptureLost() OVERRIDE { 183 virtual void OnCaptureLost() OVERRIDE {
184 capture_lost_count_++; 184 capture_lost_count_++;
185 } 185 }
186 186
187 private: 187 private:
188 int capture_changed_event_count_; 188 int capture_changed_event_count_;
189 int capture_lost_count_; 189 int capture_lost_count_;
190 int mouse_event_count_; 190 int mouse_event_count_;
191 int touch_event_count_; 191 int touch_event_count_;
(...skipping 19 matching lines...) Expand all
211 211
212 private: 212 private:
213 aura::Window* previous_focused_window_; 213 aura::Window* previous_focused_window_;
214 }; 214 };
215 215
216 // Keeps track of the location of the gesture. 216 // Keeps track of the location of the gesture.
217 class GestureTrackPositionDelegate : public TestWindowDelegate { 217 class GestureTrackPositionDelegate : public TestWindowDelegate {
218 public: 218 public:
219 GestureTrackPositionDelegate() {} 219 GestureTrackPositionDelegate() {}
220 220
221 virtual ui::GestureStatus OnGestureEvent( 221 virtual ui::EventResult OnGestureEvent(
222 ui::GestureEvent* event) OVERRIDE { 222 ui::GestureEvent* event) OVERRIDE {
223 position_ = event->location(); 223 position_ = event->location();
224 return ui::GESTURE_STATUS_CONSUMED; 224 return ui::ER_CONSUMED;
225 } 225 }
226 226
227 const gfx::Point& position() const { return position_; } 227 const gfx::Point& position() const { return position_; }
228 228
229 private: 229 private:
230 gfx::Point position_; 230 gfx::Point position_;
231 231
232 DISALLOW_COPY_AND_ASSIGN(GestureTrackPositionDelegate); 232 DISALLOW_COPY_AND_ASSIGN(GestureTrackPositionDelegate);
233 }; 233 };
234 234
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after
2536 // Move |w2| to be a child of |w1|. 2536 // Move |w2| to be a child of |w1|.
2537 w1->AddChild(w2.get()); 2537 w1->AddChild(w2.get());
2538 // Sine we moved in the same root, observer shouldn't be notified. 2538 // Sine we moved in the same root, observer shouldn't be notified.
2539 EXPECT_EQ("0 0", observer.CountStringAndReset()); 2539 EXPECT_EQ("0 0", observer.CountStringAndReset());
2540 // |w2| should still have focus after moving. 2540 // |w2| should still have focus after moving.
2541 EXPECT_TRUE(w2->HasFocus()); 2541 EXPECT_TRUE(w2->HasFocus());
2542 } 2542 }
2543 2543
2544 } // namespace test 2544 } // namespace test
2545 } // namespace aura 2545 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_delegate.cc ('k') | ui/base/events.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698