OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_HOST_CLIPBOARD_AURA_H_ | 5 #ifndef REMOTING_HOST_CLIPBOARD_AURA_H_ |
6 #define REMOTING_HOST_CLIPBOARD_AURA_H_ | 6 #define REMOTING_HOST_CLIPBOARD_AURA_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // always posts the call to the |ui_task_runner|. On ChromeOS, that should | 27 // always posts the call to the |ui_task_runner|. On ChromeOS, that should |
28 // be the UI thread of the browser process. | 28 // be the UI thread of the browser process. |
29 class ClipboardAura : public Clipboard { | 29 class ClipboardAura : public Clipboard { |
30 public: | 30 public: |
31 explicit ClipboardAura(); | 31 explicit ClipboardAura(); |
32 ~ClipboardAura() override; | 32 ~ClipboardAura() override; |
33 | 33 |
34 // Clipboard interface. | 34 // Clipboard interface. |
35 void Start(scoped_ptr<protocol::ClipboardStub> client_clipboard) override; | 35 void Start(scoped_ptr<protocol::ClipboardStub> client_clipboard) override; |
36 void InjectClipboardEvent(const protocol::ClipboardEvent& event) override; | 36 void InjectClipboardEvent(const protocol::ClipboardEvent& event) override; |
37 void Stop() override; | |
38 | 37 |
39 // Overrides the clipboard polling interval for unit test. | 38 // Overrides the clipboard polling interval for unit test. |
40 void SetPollingIntervalForTesting(base::TimeDelta polling_interval); | 39 void SetPollingIntervalForTesting(base::TimeDelta polling_interval); |
41 | 40 |
42 private: | 41 private: |
43 void CheckClipboardForChanges(); | 42 void CheckClipboardForChanges(); |
44 | 43 |
45 base::ThreadChecker thread_checker_; | 44 base::ThreadChecker thread_checker_; |
46 scoped_ptr<protocol::ClipboardStub> client_clipboard_; | 45 scoped_ptr<protocol::ClipboardStub> client_clipboard_; |
47 base::RepeatingTimer<ClipboardAura> clipboard_polling_timer_; | 46 base::RepeatingTimer<ClipboardAura> clipboard_polling_timer_; |
48 uint64 current_change_count_; | 47 uint64 current_change_count_; |
49 base::TimeDelta polling_interval_; | 48 base::TimeDelta polling_interval_; |
50 | 49 |
51 DISALLOW_COPY_AND_ASSIGN(ClipboardAura); | 50 DISALLOW_COPY_AND_ASSIGN(ClipboardAura); |
52 }; | 51 }; |
53 | 52 |
54 } // namespace remoting | 53 } // namespace remoting |
55 | 54 |
56 #endif // REMOTING_HOST_CLIPBOARD_AURA_H_ | 55 #endif // REMOTING_HOST_CLIPBOARD_AURA_H_ |
OLD | NEW |