Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: ui/base/x/selection_requestor.cc

Issue 14061025: ui: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/models/simple_menu_model.cc ('k') | ui/base/x/x11_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/base/models/simple_menu_model.cc ('k') | ui/base/x/x11_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698