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 #include "ash/system/chromeos/power/video_activity_notifier.h" | 5 #include "ash/system/chromeos/power/video_activity_notifier.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "chromeos/dbus/dbus_thread_manager.h" | 8 #include "chromeos/dbus/dbus_thread_manager.h" |
9 #include "chromeos/dbus/power_manager_client.h" | 9 #include "chromeos/dbus/power_manager_client.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 namespace internal { | |
13 | |
14 namespace { | 12 namespace { |
15 | 13 |
16 // Minimum number of seconds between notifications. | 14 // Minimum number of seconds between notifications. |
17 const int kNotifyIntervalSec = 5; | 15 const int kNotifyIntervalSec = 5; |
18 | 16 |
19 } // namespace | 17 } // namespace |
20 | 18 |
21 VideoActivityNotifier::VideoActivityNotifier(VideoDetector* detector) | 19 VideoActivityNotifier::VideoActivityNotifier(VideoDetector* detector) |
22 : detector_(detector), | 20 : detector_(detector), |
23 screen_is_locked_(false) { | 21 screen_is_locked_(false) { |
(...skipping 16 matching lines...) Expand all Loading... |
40 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 38 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
41 NotifyVideoActivity(is_fullscreen); | 39 NotifyVideoActivity(is_fullscreen); |
42 last_notify_time_ = now; | 40 last_notify_time_ = now; |
43 } | 41 } |
44 } | 42 } |
45 | 43 |
46 void VideoActivityNotifier::OnLockStateChanged(bool locked) { | 44 void VideoActivityNotifier::OnLockStateChanged(bool locked) { |
47 screen_is_locked_ = locked; | 45 screen_is_locked_ = locked; |
48 } | 46 } |
49 | 47 |
50 } // namespace internal | |
51 } // namespace ash | 48 } // namespace ash |
OLD | NEW |