Enable Enhanced Bookmark on Android Tablet
[chromium-blink-merge.git] / remoting / host / chromeos / clipboard_aura.h
blob9907fb6dfd8bbf8bf24d4d9602d1c98c1bf1f23d
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.
5 #ifndef REMOTING_HOST_CLIPBOARD_AURA_H_
6 #define REMOTING_HOST_CLIPBOARD_AURA_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/single_thread_task_runner.h"
10 #include "remoting/host/clipboard.h"
12 namespace remoting {
14 namespace protocol {
15 class ClipboardStub;
16 } // namespace protocol
18 // On Chrome OS, the clipboard is managed by aura instead of the underlying
19 // native platform (e.g. x11, ozone, etc).
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.
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.
29 class ClipboardAura : public Clipboard {
30 public:
31 explicit ClipboardAura(
32 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
33 ~ClipboardAura() override;
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;
40 // Overrides the clipboard polling interval for unit test.
41 void SetPollingIntervalForTesting(base::TimeDelta polling_interval);
43 private:
44 class Core;
46 scoped_ptr<Core> core_;
47 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
49 DISALLOW_COPY_AND_ASSIGN(ClipboardAura);
52 } // namespace remoting
54 #endif // REMOTING_HOST_CLIPBOARD_AURA_H_