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_loop/message_pump_aurax11.h" | 7 #include "base/message_loop/message_pump_x11.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 #include "ui/base/x/x11_util.h" | 10 #include "ui/base/x/x11_util.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const char kChromeSelection[] = "CHROME_SELECTION"; | 16 const char kChromeSelection[] = "CHROME_SELECTION"; |
17 | 17 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 selection_name_, | 49 selection_name_, |
50 target, | 50 target, |
51 property_to_set, | 51 property_to_set, |
52 x_window_, | 52 x_window_, |
53 CurrentTime); | 53 CurrentTime); |
54 | 54 |
55 // Now that we've thrown our message off to the X11 server, we block waiting | 55 // Now that we've thrown our message off to the X11 server, we block waiting |
56 // for a response. | 56 // for a response. |
57 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); | 57 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); |
58 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); | 58 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); |
59 base::RunLoop run_loop(base::MessagePumpAuraX11::Current()); | 59 base::RunLoop run_loop(base::MessagePumpX11::Current()); |
60 | 60 |
61 current_target_ = target; | 61 current_target_ = target; |
62 in_nested_loop_ = true; | 62 in_nested_loop_ = true; |
63 quit_closure_ = run_loop.QuitClosure(); | 63 quit_closure_ = run_loop.QuitClosure(); |
64 run_loop.Run(); | 64 run_loop.Run(); |
65 in_nested_loop_ = false; | 65 in_nested_loop_ = false; |
66 current_target_ = None; | 66 current_target_ = None; |
67 | 67 |
68 if (returned_property_ != property_to_set) | 68 if (returned_property_ != property_to_set) |
69 return false; | 69 return false; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // I am assuming that if some other client sent us a message after we've | 107 // I am assuming that if some other client sent us a message after we've |
108 // asked for data, but it's malformed, we should just treat as if they sent | 108 // asked for data, but it's malformed, we should just treat as if they sent |
109 // us an error message. | 109 // us an error message. |
110 returned_property_ = None; | 110 returned_property_ = None; |
111 } | 111 } |
112 | 112 |
113 quit_closure_.Run(); | 113 quit_closure_.Run(); |
114 } | 114 } |
115 | 115 |
116 } // namespace ui | 116 } // namespace ui |
OLD | NEW |