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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_dispatcher_client.cc

Issue 219743002: x11: Move X event handling out of the message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r261267 Created 6 years, 8 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/views/views.gyp ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/widget/desktop_aura/desktop_dispatcher_client.h" 5 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 9
10 namespace views { 10 namespace views {
11 11
12 DesktopDispatcherClient::DesktopDispatcherClient() 12 DesktopDispatcherClient::DesktopDispatcherClient()
13 : weak_ptr_factory_(this) {} 13 : weak_ptr_factory_(this) {}
14 14
15 DesktopDispatcherClient::~DesktopDispatcherClient() { 15 DesktopDispatcherClient::~DesktopDispatcherClient() {
16 } 16 }
17 17
18 void DesktopDispatcherClient::RunWithDispatcher( 18 void DesktopDispatcherClient::RunWithDispatcher(
19 base::MessagePumpDispatcher* nested_dispatcher) { 19 base::MessagePumpDispatcher* nested_dispatcher) {
20 // TODO(erg): This class has been copypastad from 20 // TODO(erg): This class has been copypastad from
21 // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes 21 // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes
22 // commented out because I don't entirely understand the implications of the 22 // commented out because I don't entirely understand the implications of the
23 // change. 23 // change.
24 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); 24 base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
25 base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop); 25 base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
26 26
27 base::Closure old_quit_closure = quit_closure_; 27 base::Closure old_quit_closure = quit_closure_;
28 #if defined(OS_WIN)
28 base::RunLoop run_loop(nested_dispatcher); 29 base::RunLoop run_loop(nested_dispatcher);
30 #else
31 base::RunLoop run_loop;
32 #endif
33
29 quit_closure_ = run_loop.QuitClosure(); 34 quit_closure_ = run_loop.QuitClosure();
30 base::WeakPtr<DesktopDispatcherClient> alive(weak_ptr_factory_.GetWeakPtr()); 35 base::WeakPtr<DesktopDispatcherClient> alive(weak_ptr_factory_.GetWeakPtr());
31 run_loop.Run(); 36 run_loop.Run();
32 if (alive) { 37 if (alive) {
33 weak_ptr_factory_.InvalidateWeakPtrs(); 38 weak_ptr_factory_.InvalidateWeakPtrs();
34 quit_closure_ = old_quit_closure; 39 quit_closure_ = old_quit_closure;
35 } 40 }
36 } 41 }
37 42
38 void DesktopDispatcherClient::QuitNestedMessageLoop() { 43 void DesktopDispatcherClient::QuitNestedMessageLoop() {
39 CHECK(!quit_closure_.is_null()); 44 CHECK(!quit_closure_.is_null());
40 quit_closure_.Run(); 45 quit_closure_.Run();
41 } 46 }
42 47
43 } // namespace views 48 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698