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

Side by Side Diff: remoting/host/host_power_save_blocker.h

Issue 2080723008: [Chromoting] Use device::PowerSaveBlocker to block screen saver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve review comments Created 4 years, 5 months 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 | « remoting/host/DEPS ('k') | remoting/host/host_power_save_blocker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/host_status_observer.h"
15
16 namespace base {
17
18 class SingleThreadTaskRunner;
19
20 } // namespace base
21
22 namespace remoting {
23
24 class AutoThreadTaskRunner;
25 class HostStatusMonitor;
26
27 // A HostStatusObserver to block screen saver from taking effect during the
28 // lifetime of a remoting connection.
29 class HostPowerSaveBlocker : public HostStatusObserver {
30 public:
31 HostPowerSaveBlocker(
32 base::WeakPtr<HostStatusMonitor> monitor,
33 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner,
34 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner);
35
36 ~HostPowerSaveBlocker() override;
37
38 void OnClientConnected(const std::string& jid) override;
39 void OnClientDisconnected(const std::string& jid) override;
40
41 private:
42 friend class HostPowerSaveBlockerTest;
43
44 base::WeakPtr<HostStatusMonitor> monitor_;
45 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
46 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
47 std::unique_ptr<device::PowerSaveBlocker> blocker_;
48 };
49
50 } // namespace remoting
51
52 #endif // REMOTING_HOST_HOST_POWER_SAVER_BLOCKER_H_
OLDNEW
« no previous file with comments | « remoting/host/DEPS ('k') | remoting/host/host_power_save_blocker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698