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

Side by Side Diff: ash/wm/user_activity_detector.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 | « ash/wm/toplevel_window_event_handler.cc ('k') | ash/wm/user_activity_detector.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 ASH_WM_USER_ACTIVITY_DETECTOR_H_ 5 #ifndef ASH_WM_USER_ACTIVITY_DETECTOR_H_
6 #define ASH_WM_USER_ACTIVITY_DETECTOR_H_ 6 #define ASH_WM_USER_ACTIVITY_DETECTOR_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 17 matching lines...) Expand all
28 void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; } 28 void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; }
29 29
30 bool HasObserver(UserActivityObserver* observer) const; 30 bool HasObserver(UserActivityObserver* observer) const;
31 void AddObserver(UserActivityObserver* observer); 31 void AddObserver(UserActivityObserver* observer);
32 void RemoveObserver(UserActivityObserver* observer); 32 void RemoveObserver(UserActivityObserver* observer);
33 33
34 // Called when chrome has received a request to turn of all displays. 34 // Called when chrome has received a request to turn of all displays.
35 void OnAllOutputsTurnedOff(); 35 void OnAllOutputsTurnedOff();
36 36
37 // ui::EventHandler implementation. 37 // ui::EventHandler implementation.
38 virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; 38 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
39 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; 39 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
40 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; 40 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
41 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; 41 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
42 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 42 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
43 43
44 private: 44 private:
45 // Notifies observers if enough time has passed since the last notification. 45 // Notifies observers if enough time has passed since the last notification.
46 void MaybeNotify(); 46 void MaybeNotify();
47 47
48 ObserverList<UserActivityObserver> observers_; 48 ObserverList<UserActivityObserver> observers_;
49 49
50 // Last time at which we notified observers that the user was active. 50 // Last time at which we notified observers that the user was active.
51 base::TimeTicks last_observer_notification_time_; 51 base::TimeTicks last_observer_notification_time_;
52 52
53 // If set, used when the current time is needed. This can be set by tests to 53 // If set, used when the current time is needed. This can be set by tests to
54 // simulate the passage of time. 54 // simulate the passage of time.
55 base::TimeTicks now_for_test_; 55 base::TimeTicks now_for_test_;
56 56
57 // When this is true, the next mouse event is ignored. This is to 57 // When this is true, the next mouse event is ignored. This is to
58 // avoid mis-detecting a mouse enter event that occurs when turning 58 // avoid mis-detecting a mouse enter event that occurs when turning
59 // off display as a user activity. 59 // off display as a user activity.
60 bool ignore_next_mouse_event_; 60 bool ignore_next_mouse_event_;
61 61
62 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); 62 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector);
63 }; 63 };
64 64
65 } // namespace ash 65 } // namespace ash
66 66
67 #endif // ASH_WM_USER_ACTIVITY_DETECTOR_H_ 67 #endif // ASH_WM_USER_ACTIVITY_DETECTOR_H_
OLDNEW
« no previous file with comments | « ash/wm/toplevel_window_event_handler.cc ('k') | ash/wm/user_activity_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698