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

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

Issue 182143002: Use the default dispatcher where possible for nested message loops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar-fix Created 6 years, 9 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/widget/desktop_aura/desktop_dispatcher_client.h ('k') | no next file » | 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/run_loop.h" 8 #include "base/run_loop.h"
8 9
9 namespace views { 10 namespace views {
10 11
11 DesktopDispatcherClient::DesktopDispatcherClient() {} 12 DesktopDispatcherClient::DesktopDispatcherClient() {}
12 13
13 DesktopDispatcherClient::~DesktopDispatcherClient() {} 14 DesktopDispatcherClient::~DesktopDispatcherClient() {}
14 15
15 void DesktopDispatcherClient::RunWithDispatcher( 16 void DesktopDispatcherClient::RunWithDispatcher(
16 base::MessagePumpDispatcher* nested_dispatcher, 17 base::MessagePumpDispatcher* nested_dispatcher,
17 aura::Window* associated_window) { 18 aura::Window* associated_window) {
18 // TODO(erg): This class has been copypastad from 19 // TODO(erg): This class has been copypastad from
19 // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes 20 // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes
20 // commented out because I don't entirely understand the implications of the 21 // commented out because I don't entirely understand the implications of the
21 // change. 22 // change.
22 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); 23 base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
23 base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop); 24 base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
24 25
25 base::RunLoop run_loop(nested_dispatcher); 26 base::RunLoop run_loop(nested_dispatcher);
27 base::AutoReset<base::Closure> reset_closure(&quit_closure_,
28 run_loop.QuitClosure());
26 run_loop.Run(); 29 run_loop.Run();
27 } 30 }
28 31
32 void DesktopDispatcherClient::QuitNestedMessageLoop() {
33 CHECK(!quit_closure_.is_null());
34 quit_closure_.Run();
35 }
36
29 } // namespace views 37 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_dispatcher_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698