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

Side by Side Diff: ui/events/event.h

Issue 398393003: Require a mouse button release event before counting a press event as a new click. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | ui/events/event.cc » ('j') | ui/events/event.cc » ('J')
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_EVENTS_EVENT_H_ 5 #ifndef UI_EVENTS_EVENT_H_
6 #define UI_EVENTS_EVENT_H_ 6 #define UI_EVENTS_EVENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/event_types.h" 10 #include "base/event_types.h"
11 #include "base/gtest_prod_util.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/time/time.h" 13 #include "base/time/time.h"
13 #include "ui/events/event_constants.h" 14 #include "ui/events/event_constants.h"
14 #include "ui/events/gesture_event_details.h" 15 #include "ui/events/gesture_event_details.h"
15 #include "ui/events/gestures/gesture_types.h" 16 #include "ui/events/gestures/gesture_types.h"
16 #include "ui/events/keycodes/keyboard_codes.h" 17 #include "ui/events/keycodes/keyboard_codes.h"
17 #include "ui/events/latency_info.h" 18 #include "ui/events/latency_info.h"
18 #include "ui/gfx/point.h" 19 #include "ui/gfx/point.h"
19 #include "ui/gfx/point_conversions.h" 20 #include "ui/gfx/point_conversions.h"
20 21
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 391
391 // Identifies the button that changed. During a press this corresponds to the 392 // Identifies the button that changed. During a press this corresponds to the
392 // button that was pressed and during a release this corresponds to the button 393 // button that was pressed and during a release this corresponds to the button
393 // that was released. 394 // that was released.
394 // NOTE: during a press and release flags() contains the complete set of 395 // NOTE: during a press and release flags() contains the complete set of
395 // flags. Use this to determine the button that was pressed or released. 396 // flags. Use this to determine the button that was pressed or released.
396 int changed_button_flags() const { return changed_button_flags_; } 397 int changed_button_flags() const { return changed_button_flags_; }
397 void set_changed_button_flags(int flags) { changed_button_flags_ = flags; } 398 void set_changed_button_flags(int flags) { changed_button_flags_ = flags; }
398 399
399 private: 400 private:
401 FRIEND_TEST_ALL_PREFIXES(EventTest, DoubleClickRequiresRelease);
402
400 // Returns the repeat count based on the previous mouse click, if it is 403 // Returns the repeat count based on the previous mouse click, if it is
401 // recent enough and within a small enough distance. 404 // recent enough and within a small enough distance.
402 static int GetRepeatCount(const MouseEvent& click_event); 405 static int GetRepeatCount(const MouseEvent& click_event);
403 406
404 // See description above getter for details. 407 // See description above getter for details.
405 int changed_button_flags_; 408 int changed_button_flags_;
406 409
407 static MouseEvent* last_click_event_; 410 static MouseEvent* last_click_event_;
411 static bool last_click_released_;
408 }; 412 };
409 413
410 class ScrollEvent; 414 class ScrollEvent;
411 415
412 class EVENTS_EXPORT MouseWheelEvent : public MouseEvent { 416 class EVENTS_EXPORT MouseWheelEvent : public MouseEvent {
413 public: 417 public:
414 // See |offset| for details. 418 // See |offset| for details.
415 static const int kWheelDelta; 419 static const int kWheelDelta;
416 420
417 explicit MouseWheelEvent(const base::NativeEvent& native_event); 421 explicit MouseWheelEvent(const base::NativeEvent& native_event);
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 682
679 const GestureEventDetails& details() const { return details_; } 683 const GestureEventDetails& details() const { return details_; }
680 684
681 private: 685 private:
682 GestureEventDetails details_; 686 GestureEventDetails details_;
683 }; 687 };
684 688
685 } // namespace ui 689 } // namespace ui
686 690
687 #endif // UI_EVENTS_EVENT_H_ 691 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | ui/events/event.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698