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

Side by Side Diff: remoting/host/screen_saver_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
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_SCREEN_SAVER_BLOCKER_H_
6 #define REMOTING_HOST_SCREEN_SAVER_BLOCKER_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/memory/weak_ptr.h"
12 #include "device/power_save_blocker/power_save_blocker.h"
13 #include "remoting/host/chromoting_host_context.h"
14 #include "remoting/host/host_status_observer.h"
15
16 namespace remoting {
17
18 class HostStatusMonitor;
19
20 // A HostStatusObserver to block screen saver from taking effect during the
21 // lifetime of a remoting connection.
22 class ScreenSaverBlocker : public HostStatusObserver {
Sergey Ulanov 2016/07/08 21:31:47 I don't think this is the best name, as it blocks
Hzj_jie 2016/07/10 22:04:57 Indeed blocking screensaver implies the suspending
23 public:
24 ScreenSaverBlocker(base::WeakPtr<HostStatusMonitor> monitor,
25 std::unique_ptr<ChromotingHostContext>&& context);
Sergey Ulanov 2016/07/08 21:31:47 Please pass unique_ptr by value instead of rvalue.
Hzj_jie 2016/07/10 22:04:57 Done.
26
27 ~ScreenSaverBlocker() override;
28
29 void OnClientConnected(const std::string& jid) override;
30 void OnClientDisconnected(const std::string& jid) override;
31
32 private:
33 base::WeakPtr<HostStatusMonitor> monitor_;
34 std::unique_ptr<ChromotingHostContext> context_;
35 std::unique_ptr<device::PowerSaveBlocker> blocker_;
36 };
37
38 } // namespace remoting
39
40 #endif // REMOTING_HOST_SCREEN_SAVER_BLOCKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698