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

Side by Side Diff: ui/base/user_activity/user_activity_detector.h

Issue 2524863003: Move DisplayChangeObserver + tests from ash to ui. (Closed)
Patch Set: Replace with static method. Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ 5 #ifndef UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_
6 #define UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ 6 #define UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 15 matching lines...) Expand all
26 // Amount of time that mouse events should be ignored after notification 26 // Amount of time that mouse events should be ignored after notification
27 // is received that displays' power states are being changed. 27 // is received that displays' power states are being changed.
28 static const int kDisplayPowerChangeIgnoreMouseMs; 28 static const int kDisplayPowerChangeIgnoreMouseMs;
29 29
30 UserActivityDetector(); 30 UserActivityDetector();
31 ~UserActivityDetector() override; 31 ~UserActivityDetector() override;
32 32
33 // Returns the UserActivityDetector instance if one was created. 33 // Returns the UserActivityDetector instance if one was created.
34 static UserActivityDetector* Get(); 34 static UserActivityDetector* Get();
35 35
36 // Calls OnDisplayPowerChanging() on instance if one was created.
37 static void OnDisplayPowerChangingStatic();
sadrul 2016/11/29 18:24:40 Do we need 'Static'?
kylechar 2016/11/30 22:53:31 A change in a parent CL has made this unnecessary
38
36 base::TimeTicks last_activity_time() const { return last_activity_time_; } 39 base::TimeTicks last_activity_time() const { return last_activity_time_; }
37 std::string last_activity_name() const { return last_activity_name_; } 40 std::string last_activity_name() const { return last_activity_name_; }
38 41
39 void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; } 42 void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; }
40 43
41 bool HasObserver(const UserActivityObserver* observer) const; 44 bool HasObserver(const UserActivityObserver* observer) const;
42 void AddObserver(UserActivityObserver* observer); 45 void AddObserver(UserActivityObserver* observer);
43 void RemoveObserver(UserActivityObserver* observer); 46 void RemoveObserver(UserActivityObserver* observer);
44 47
45 // Called when displays are about to be turned on or off. 48 // Called when displays are about to be turned on or off.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // is to avoid reporting mouse events that occur when displays are turned 85 // is to avoid reporting mouse events that occur when displays are turned
83 // on or off as user activity. 86 // on or off as user activity.
84 base::TimeTicks honor_mouse_events_time_; 87 base::TimeTicks honor_mouse_events_time_;
85 88
86 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); 89 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector);
87 }; 90 };
88 91
89 } // namespace ui 92 } // namespace ui
90 93
91 #endif // UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ 94 #endif // UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698