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 #include "remoting/host/chromeos/clipboard_aura.h" | 5 #include "remoting/host/chromeos/clipboard_aura.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace remoting { | 24 namespace remoting { |
25 | 25 |
26 ClipboardAura::ClipboardAura() | 26 ClipboardAura::ClipboardAura() |
27 : current_change_count_(0), | 27 : current_change_count_(0), |
28 polling_interval_( | 28 polling_interval_( |
29 base::TimeDelta::FromMilliseconds(kClipboardPollingIntervalMs)) { | 29 base::TimeDelta::FromMilliseconds(kClipboardPollingIntervalMs)) { |
30 } | 30 } |
31 | 31 |
32 ClipboardAura::~ClipboardAura() { | 32 ClipboardAura::~ClipboardAura() { |
| 33 DCHECK(thread_checker_.CalledOnValidThread()); |
33 } | 34 } |
34 | 35 |
35 void ClipboardAura::Start( | 36 void ClipboardAura::Start( |
36 std::unique_ptr<protocol::ClipboardStub> client_clipboard) { | 37 std::unique_ptr<protocol::ClipboardStub> client_clipboard) { |
37 DCHECK(thread_checker_.CalledOnValidThread()); | 38 DCHECK(thread_checker_.CalledOnValidThread()); |
38 | 39 |
39 client_clipboard_ = std::move(client_clipboard); | 40 client_clipboard_ = std::move(client_clipboard); |
40 | 41 |
41 // Aura doesn't provide a clipboard-changed notification. The only way to | 42 // Aura doesn't provide a clipboard-changed notification. The only way to |
42 // detect clipboard changes is by polling. | 43 // detect clipboard changes is by polling. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 event.set_data(data); | 90 event.set_data(data); |
90 | 91 |
91 client_clipboard_->InjectClipboardEvent(event); | 92 client_clipboard_->InjectClipboardEvent(event); |
92 } | 93 } |
93 | 94 |
94 std::unique_ptr<Clipboard> Clipboard::Create() { | 95 std::unique_ptr<Clipboard> Clipboard::Create() { |
95 return base::WrapUnique(new ClipboardAura()); | 96 return base::WrapUnique(new ClipboardAura()); |
96 } | 97 } |
97 | 98 |
98 } // namespace remoting | 99 } // namespace remoting |
OLD | NEW |