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

Side by Side Diff: ui/wm/core/user_activity_detector.h

Issue 697953002: ObserverList::HasObserver now takes a const pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile errors (ChromeOS unit tests). Created 6 years, 1 month 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
« no previous file with comments | « ui/views/widget/widget.cc ('k') | ui/wm/core/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 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_WM_CORE_USER_ACTIVITY_DETECTOR_H_ 5 #ifndef UI_WM_CORE_USER_ACTIVITY_DETECTOR_H_
6 #define UI_WM_CORE_USER_ACTIVITY_DETECTOR_H_ 6 #define UI_WM_CORE_USER_ACTIVITY_DETECTOR_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/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 18 matching lines...) Expand all
29 UserActivityDetector(); 29 UserActivityDetector();
30 ~UserActivityDetector() override; 30 ~UserActivityDetector() override;
31 31
32 // Returns the UserActivityDetector instance if one was created. 32 // Returns the UserActivityDetector instance if one was created.
33 static UserActivityDetector* Get(); 33 static UserActivityDetector* Get();
34 34
35 base::TimeTicks last_activity_time() const { return last_activity_time_; } 35 base::TimeTicks last_activity_time() const { return last_activity_time_; }
36 36
37 void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; } 37 void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; }
38 38
39 bool HasObserver(UserActivityObserver* observer) const; 39 bool HasObserver(const UserActivityObserver* observer) const;
40 void AddObserver(UserActivityObserver* observer); 40 void AddObserver(UserActivityObserver* observer);
41 void RemoveObserver(UserActivityObserver* observer); 41 void RemoveObserver(UserActivityObserver* observer);
42 42
43 // Called when displays are about to be turned on or off. 43 // Called when displays are about to be turned on or off.
44 void OnDisplayPowerChanging(); 44 void OnDisplayPowerChanging();
45 45
46 // ui::EventHandler implementation. 46 // ui::EventHandler implementation.
47 void OnKeyEvent(ui::KeyEvent* event) override; 47 void OnKeyEvent(ui::KeyEvent* event) override;
48 void OnMouseEvent(ui::MouseEvent* event) override; 48 void OnMouseEvent(ui::MouseEvent* event) override;
49 void OnScrollEvent(ui::ScrollEvent* event) override; 49 void OnScrollEvent(ui::ScrollEvent* event) override;
(...skipping 25 matching lines...) Expand all
75 // is to avoid reporting mouse events that occur when displays are turned 75 // is to avoid reporting mouse events that occur when displays are turned
76 // on or off as user activity. 76 // on or off as user activity.
77 base::TimeTicks honor_mouse_events_time_; 77 base::TimeTicks honor_mouse_events_time_;
78 78
79 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); 79 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector);
80 }; 80 };
81 81
82 } // namespace wm 82 } // namespace wm
83 83
84 #endif // UI_WM_CORE_USER_ACTIVITY_DETECTOR_H_ 84 #endif // UI_WM_CORE_USER_ACTIVITY_DETECTOR_H_
OLDNEW
« no previous file with comments | « ui/views/widget/widget.cc ('k') | ui/wm/core/user_activity_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698