OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/base/x/selection_requestor.h" | 5 #include "ui/base/x/selection_requestor.h" |
6 | 6 |
7 #include "base/message_pump_aurax11.h" | 7 #include "base/message_pump_aurax11.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "ui/base/x/selection_utils.h" | 9 #include "ui/base/x/selection_utils.h" |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 XConvertSelection(x_display_, | 47 XConvertSelection(x_display_, |
48 selection_name_, | 48 selection_name_, |
49 target, | 49 target, |
50 property_to_set, | 50 property_to_set, |
51 x_window_, | 51 x_window_, |
52 CurrentTime); | 52 CurrentTime); |
53 | 53 |
54 // Now that we've thrown our message off to the X11 server, we block waiting | 54 // Now that we've thrown our message off to the X11 server, we block waiting |
55 // for a response. | 55 // for a response. |
56 MessageLoopForUI* loop = MessageLoopForUI::current(); | 56 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); |
57 MessageLoop::ScopedNestableTaskAllower allow_nested(loop); | 57 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); |
58 base::RunLoop run_loop(base::MessagePumpAuraX11::Current()); | 58 base::RunLoop run_loop(base::MessagePumpAuraX11::Current()); |
59 | 59 |
60 current_target_ = target; | 60 current_target_ = target; |
61 in_nested_loop_ = true; | 61 in_nested_loop_ = true; |
62 quit_closure_ = run_loop.QuitClosure(); | 62 quit_closure_ = run_loop.QuitClosure(); |
63 run_loop.Run(); | 63 run_loop.Run(); |
64 in_nested_loop_ = false; | 64 in_nested_loop_ = false; |
65 current_target_ = None; | 65 current_target_ = None; |
66 | 66 |
67 if (returned_property_ != property_to_set) | 67 if (returned_property_ != property_to_set) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // I am assuming that if some other client sent us a message after we've | 153 // I am assuming that if some other client sent us a message after we've |
154 // asked for data, but it's malformed, we should just treat as if they sent | 154 // asked for data, but it's malformed, we should just treat as if they sent |
155 // us an error message. | 155 // us an error message. |
156 returned_property_ = None; | 156 returned_property_ = None; |
157 } | 157 } |
158 | 158 |
159 quit_closure_.Run(); | 159 quit_closure_.Run(); |
160 } | 160 } |
161 | 161 |
162 } // namespace ui | 162 } // namespace ui |
OLD | NEW |