| 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/common/dbus_thread_manager_ash.h" |
| 7 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 9 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 10 #include "chromeos/dbus/dbus_thread_manager.h" | 11 // #include "chromeos/dbus/dbus_thread_manager.h" |
| 11 #include "chromeos/dbus/power_manager_client.h" | 12 #include "chromeos/dbus/power_manager_client.h" |
| 12 | 13 |
| 13 namespace ash { | 14 namespace ash { |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 // Minimum number of seconds between repeated notifications of the same state. | 17 // Minimum number of seconds between repeated notifications of the same state. |
| 17 // This should be less than powerd's timeout for determining whether video is | 18 // This should be less than powerd's timeout for determining whether video is |
| 18 // still active for the purposes of controlling the keyboard backlight. | 19 // still active for the purposes of controlling the keyboard backlight. |
| 19 const int kNotifyIntervalSec = 5; | 20 const int kNotifyIntervalSec = 5; |
| 20 | 21 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 notify_timer_.Stop(); | 67 notify_timer_.Stop(); |
| 67 } else { | 68 } else { |
| 68 notify_timer_.Start(FROM_HERE, | 69 notify_timer_.Start(FROM_HERE, |
| 69 base::TimeDelta::FromSeconds(kNotifyIntervalSec), this, | 70 base::TimeDelta::FromSeconds(kNotifyIntervalSec), this, |
| 70 &VideoActivityNotifier::MaybeNotifyPowerManager); | 71 &VideoActivityNotifier::MaybeNotifyPowerManager); |
| 71 } | 72 } |
| 72 } | 73 } |
| 73 | 74 |
| 74 void VideoActivityNotifier::MaybeNotifyPowerManager() { | 75 void VideoActivityNotifier::MaybeNotifyPowerManager() { |
| 75 if (should_notify_power_manager()) { | 76 if (should_notify_power_manager()) { |
| 76 chromeos::DBusThreadManager::Get() | 77 DBusThreadManagerAsh::Get() |
| 77 ->GetPowerManagerClient() | 78 ->GetPowerManagerClient() |
| 78 ->NotifyVideoActivity(video_state_ == | 79 ->NotifyVideoActivity(video_state_ == |
| 79 VideoDetector::State::PLAYING_FULLSCREEN); | 80 VideoDetector::State::PLAYING_FULLSCREEN); |
| 80 } | 81 } |
| 81 } | 82 } |
| 82 | 83 |
| 83 } // namespace ash | 84 } // namespace ash |
| OLD | NEW |