Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef REMOTING_HOST_HOST_POWER_SAVER_BLOCKER_H_ | |
| 6 #define REMOTING_HOST_HOST_POWER_SAVER_BLOCKER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "device/power_save_blocker/power_save_blocker.h" | |
| 14 #include "remoting/host/chromoting_host_context.h" | |
| 15 #include "remoting/host/host_status_observer.h" | |
| 16 | |
| 17 namespace remoting { | |
| 18 | |
| 19 class HostStatusMonitor; | |
| 20 class AutoThreadTaskRunner; | |
|
Sergey Ulanov
2016/07/13 04:57:05
sort these alphabetically
Hzj_jie
2016/07/13 20:27:13
Done.
| |
| 21 | |
| 22 // A HostStatusObserver to block screen saver from taking effect during the | |
| 23 // lifetime of a remoting connection. | |
| 24 class HostPowerSaveBlocker : public HostStatusObserver { | |
| 25 public: | |
| 26 HostPowerSaveBlocker(base::WeakPtr<HostStatusMonitor> monitor, | |
| 27 const ChromotingHostContext& context); | |
| 28 | |
| 29 ~HostPowerSaveBlocker() override; | |
| 30 | |
| 31 void OnClientConnected(const std::string& jid) override; | |
| 32 void OnClientDisconnected(const std::string& jid) override; | |
| 33 | |
| 34 private: | |
| 35 base::WeakPtr<HostStatusMonitor> monitor_; | |
| 36 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; | |
| 37 scoped_refptr<AutoThreadTaskRunner> file_task_runner_; | |
| 38 std::unique_ptr<device::PowerSaveBlocker> blocker_; | |
| 39 }; | |
| 40 | |
| 41 } // namespace remoting | |
| 42 | |
| 43 #endif // REMOTING_HOST_HOST_POWER_SAVER_BLOCKER_H_ | |
| OLD | NEW |