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_CLIENT_CALLBACK_CURSOR_SHAPE_STUB_H_ | |
| 6 #define REMOTING_CLIENT_CALLBACK_CURSOR_SHAPE_STUB_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "base/single_thread_task_runner.h" | |
| 11 #include "remoting/protocol/cursor_shape_stub.h" | |
| 12 | |
| 13 namespace remoting { | |
| 14 | |
| 15 // A helper class for wrapping a cursor updating callback into a | |
| 16 // CursorShapeStub. The callback will be run when SetCursorShape is called. | |
|
Sergey Ulanov
2016/07/27 18:26:09
The comment doesn't mention that the callback is c
Yuwei
2016/07/27 19:22:28
Added comment.
| |
| 17 class CallbackCursorShapeStub : public protocol::CursorShapeStub { | |
|
Sergey Ulanov
2016/07/27 18:26:09
In other places we call classes like this that mov
Yuwei
2016/07/27 18:37:20
The class being proxied will need to implement the
Sergey Ulanov
2016/07/27 18:47:51
There is no requirement that CursorShapeStub _inte
Yuwei
2016/07/27 19:22:28
Done.
Yuwei
2016/07/27 19:22:28
Acknowledged.
| |
| 18 public: | |
| 19 // If |task_runner| is null, |callback| will be run upon the current call | |
| 20 // stack of SetCursorShape on the network thread. Otherwise it will be run | |
| 21 // on the thread of |task_runner|. | |
| 22 CallbackCursorShapeStub( | |
| 23 base::Callback<void(const protocol::CursorShapeInfo&)> callback, | |
| 24 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | |
| 25 ~CallbackCursorShapeStub() override; | |
| 26 | |
| 27 // CursorShapeStub override. | |
| 28 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; | |
| 29 | |
| 30 private: | |
| 31 base::Callback<void(const protocol::CursorShapeInfo&)> callback_; | |
| 32 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(CallbackCursorShapeStub); | |
| 35 }; | |
| 36 | |
| 37 } // namespace remoting | |
| 38 | |
| 39 #endif // REMOTING_CLIENT_CALLBACK_CURSOR_SHAPE_STUB_H_ | |
| OLD | NEW |