| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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_CLIPBOARD_AURA_H_ | |
| 6 #define REMOTING_HOST_CLIPBOARD_AURA_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "base/single_thread_task_runner.h" | |
| 10 #include "remoting/host/clipboard.h" | |
| 11 | |
| 12 namespace remoting { | |
| 13 | |
| 14 namespace protocol { | |
| 15 class ClipboardStub; | |
| 16 } // namespace protocol | |
| 17 | |
| 18 // On Chrome OS, the clipboard is managed by aura instead of the underlying | |
| 19 // native platform (e.g. x11, ozone, etc). | |
| 20 // | |
| 21 // This class (1) monitors the aura clipboard for changes and notifies the | |
| 22 // |client_clipboard|, and (2) provides an interface to inject clipboard event | |
| 23 // into aura. | |
| 24 // | |
| 25 // The public API of this class can be called in any thread as internally it | |
| 26 // always posts the call to the |ui_task_runner|. On ChromeOS, that should | |
| 27 // be the UI thread of the browser process. | |
| 28 // | |
| 29 class ClipboardAura : public Clipboard { | |
| 30 public: | |
| 31 explicit ClipboardAura( | |
| 32 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | |
| 33 ~ClipboardAura() override; | |
| 34 | |
| 35 // Clipboard interface. | |
| 36 void Start(scoped_ptr<protocol::ClipboardStub> client_clipboard) override; | |
| 37 void InjectClipboardEvent(const protocol::ClipboardEvent& event) override; | |
| 38 void Stop() override; | |
| 39 | |
| 40 // Overrides the clipboard polling interval for unit test. | |
| 41 void SetPollingIntervalForTesting(base::TimeDelta polling_interval); | |
| 42 | |
| 43 private: | |
| 44 class Core; | |
| 45 | |
| 46 scoped_ptr<Core> core_; | |
| 47 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(ClipboardAura); | |
| 50 }; | |
| 51 | |
| 52 } // namespace remoting | |
| 53 | |
| 54 #endif // REMOTING_HOST_CLIPBOARD_AURA_H_ | |
| OLD | NEW |