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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "remoting/base/constants.h" | 8 #include "remoting/base/constants.h" |
9 #include "remoting/proto/event.pb.h" | 9 #include "remoting/proto/event.pb.h" |
10 #include "remoting/protocol/clipboard_stub.h" | 10 #include "remoting/protocol/clipboard_stub.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_COPY_PASTE); | 53 ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_COPY_PASTE); |
54 clipboard_writer.WriteText(base::UTF8ToUTF16(event.data())); | 54 clipboard_writer.WriteText(base::UTF8ToUTF16(event.data())); |
55 | 55 |
56 // Update local change-count to prevent this change from being picked up by | 56 // Update local change-count to prevent this change from being picked up by |
57 // CheckClipboardForChanges. | 57 // CheckClipboardForChanges. |
58 current_change_count_++; | 58 current_change_count_++; |
59 } | 59 } |
60 | 60 |
61 void ClipboardAura::Stop() { | |
62 DCHECK(thread_checker_.CalledOnValidThread()); | |
63 | |
64 clipboard_polling_timer_.Stop(); | |
65 client_clipboard_.reset(); | |
66 }; | |
67 | |
68 void ClipboardAura::SetPollingIntervalForTesting( | 61 void ClipboardAura::SetPollingIntervalForTesting( |
69 base::TimeDelta polling_interval) { | 62 base::TimeDelta polling_interval) { |
70 DCHECK(thread_checker_.CalledOnValidThread()); | 63 DCHECK(thread_checker_.CalledOnValidThread()); |
71 | 64 |
72 polling_interval_ = polling_interval; | 65 polling_interval_ = polling_interval; |
73 } | 66 } |
74 | 67 |
75 void ClipboardAura::CheckClipboardForChanges() { | 68 void ClipboardAura::CheckClipboardForChanges() { |
76 DCHECK(thread_checker_.CalledOnValidThread()); | 69 DCHECK(thread_checker_.CalledOnValidThread()); |
77 | 70 |
(...skipping 15 matching lines...) Expand all Loading... |
93 event.set_data(data); | 86 event.set_data(data); |
94 | 87 |
95 client_clipboard_->InjectClipboardEvent(event); | 88 client_clipboard_->InjectClipboardEvent(event); |
96 } | 89 } |
97 | 90 |
98 scoped_ptr<Clipboard> Clipboard::Create() { | 91 scoped_ptr<Clipboard> Clipboard::Create() { |
99 return make_scoped_ptr(new ClipboardAura()); | 92 return make_scoped_ptr(new ClipboardAura()); |
100 } | 93 } |
101 | 94 |
102 } // namespace remoting | 95 } // namespace remoting |
OLD | NEW |