OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SYSTEM_CHROMEOS_POWER_VIDEO_ACTIVITY_NOTIFIER_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_POWER_VIDEO_ACTIVITY_NOTIFIER_H_ |
6 #define ASH_SYSTEM_CHROMEOS_POWER_VIDEO_ACTIVITY_NOTIFIER_H_ | 6 #define ASH_SYSTEM_CHROMEOS_POWER_VIDEO_ACTIVITY_NOTIFIER_H_ |
7 | 7 |
8 #include "ash/wm/video_detector.h" | 8 #include "ash/wm/video_detector.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 namespace internal { | |
15 | 14 |
16 // Notifies the power manager when a video is playing. | 15 // Notifies the power manager when a video is playing. |
17 class VideoActivityNotifier : public VideoDetectorObserver, | 16 class VideoActivityNotifier : public VideoDetectorObserver, |
18 public ShellObserver { | 17 public ShellObserver { |
19 public: | 18 public: |
20 explicit VideoActivityNotifier(VideoDetector* detector); | 19 explicit VideoActivityNotifier(VideoDetector* detector); |
21 virtual ~VideoActivityNotifier(); | 20 virtual ~VideoActivityNotifier(); |
22 | 21 |
23 // VideoDetectorObserver implementation. | 22 // VideoDetectorObserver implementation. |
24 virtual void OnVideoDetected(bool is_fullscreen) OVERRIDE; | 23 virtual void OnVideoDetected(bool is_fullscreen) OVERRIDE; |
25 | 24 |
26 // ShellObserver implementation. | 25 // ShellObserver implementation. |
27 virtual void OnLockStateChanged(bool locked) OVERRIDE; | 26 virtual void OnLockStateChanged(bool locked) OVERRIDE; |
28 | 27 |
29 private: | 28 private: |
30 VideoDetector* detector_; // not owned | 29 VideoDetector* detector_; // not owned |
31 | 30 |
32 // Last time that the power manager was notified. | 31 // Last time that the power manager was notified. |
33 base::TimeTicks last_notify_time_; | 32 base::TimeTicks last_notify_time_; |
34 | 33 |
35 // True if the screen is currently locked. | 34 // True if the screen is currently locked. |
36 bool screen_is_locked_; | 35 bool screen_is_locked_; |
37 | 36 |
38 DISALLOW_COPY_AND_ASSIGN(VideoActivityNotifier); | 37 DISALLOW_COPY_AND_ASSIGN(VideoActivityNotifier); |
39 }; | 38 }; |
40 | 39 |
41 } // namespace internal | |
42 } // namespace ash | 40 } // namespace ash |
43 | 41 |
44 #endif // ASH_SYSTEM_CHROMEOS_POWER_VIDEO_ACTIVITY_NOTIFIER_H_ | 42 #endif // ASH_SYSTEM_CHROMEOS_POWER_VIDEO_ACTIVITY_NOTIFIER_H_ |
OLD | NEW |