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

Unified Diff: ash/wm/user_activity_detector.h

Issue 12391004: chromeos: Add DisplayPowerServiceProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ugh, TrayDisplay was including output_configurator.h on windows Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/chromeos/tray_display.cc ('k') | ash/wm/user_activity_detector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/user_activity_detector.h
diff --git a/ash/wm/user_activity_detector.h b/ash/wm/user_activity_detector.h
index 55a685c1dd747421ba4583fd13c54f35e074df2c..18b3409ad1eae25397ba8c357b65669a0d94546f 100644
--- a/ash/wm/user_activity_detector.h
+++ b/ash/wm/user_activity_detector.h
@@ -20,7 +20,11 @@ class UserActivityObserver;
class ASH_EXPORT UserActivityDetector : public ui::EventHandler {
public:
// Minimum amount of time between notifications to observers.
- static const double kNotifyIntervalMs;
+ static const int kNotifyIntervalMs;
+
+ // Amount of time that mouse events should be ignored after notification
+ // is received that displays' power states are being changed.
+ static const int kDisplayPowerChangeIgnoreMouseMs;
UserActivityDetector();
virtual ~UserActivityDetector();
@@ -31,8 +35,8 @@ class ASH_EXPORT UserActivityDetector : public ui::EventHandler {
void AddObserver(UserActivityObserver* observer);
void RemoveObserver(UserActivityObserver* observer);
- // Called when chrome has received a request to turn of all displays.
- void OnAllOutputsTurnedOff();
+ // Called when displays are about to be turned on or off.
+ void OnDisplayPowerChanging();
// ui::EventHandler implementation.
virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
@@ -42,6 +46,9 @@ class ASH_EXPORT UserActivityDetector : public ui::EventHandler {
virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
private:
+ // Returns |now_for_test_| if set or base::TimeTicks::Now() otherwise.
+ base::TimeTicks GetCurrentTime() const;
+
// Notifies observers if enough time has passed since the last notification.
void MaybeNotify();
@@ -54,10 +61,10 @@ class ASH_EXPORT UserActivityDetector : public ui::EventHandler {
// simulate the passage of time.
base::TimeTicks now_for_test_;
- // When this is true, the next mouse event is ignored. This is to
- // avoid mis-detecting a mouse enter event that occurs when turning
- // off display as a user activity.
- bool ignore_next_mouse_event_;
+ // If set, mouse events will be ignored until this time is reached. This
+ // is to avoid reporting mouse events that occur when displays are turned
+ // on or off as user activity.
+ base::TimeTicks honor_mouse_events_time_;
DISALLOW_COPY_AND_ASSIGN(UserActivityDetector);
};
« no previous file with comments | « ash/system/chromeos/tray_display.cc ('k') | ash/wm/user_activity_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698