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

Side by Side Diff: ash/accelerators/nested_dispatcher_controller.cc

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: phajdan feedback Created 8 years, 5 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 | « no previous file | ash/drag_drop/drag_drop_controller.h » ('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 "ash/accelerators/nested_dispatcher_controller.h" 5 #include "ash/accelerators/nested_dispatcher_controller.h"
6 6
7 #include "ash/accelerators/accelerator_dispatcher.h" 7 #include "ash/accelerators/accelerator_dispatcher.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/run_loop.h"
9 10
10 namespace ash { 11 namespace ash {
11 12
12 NestedDispatcherController::NestedDispatcherController() { 13 NestedDispatcherController::NestedDispatcherController() {
13 } 14 }
14 15
15 NestedDispatcherController::~NestedDispatcherController() { 16 NestedDispatcherController::~NestedDispatcherController() {
16 } 17 }
17 18
18 void NestedDispatcherController::RunWithDispatcher( 19 void NestedDispatcherController::RunWithDispatcher(
19 MessageLoop::Dispatcher* nested_dispatcher, 20 MessageLoop::Dispatcher* nested_dispatcher,
20 aura::Window* associated_window, 21 aura::Window* associated_window,
21 bool nestable_tasks_allowed) { 22 bool nestable_tasks_allowed) {
22 MessageLoopForUI* loop = MessageLoopForUI::current(); 23 MessageLoopForUI* loop = MessageLoopForUI::current();
23 bool did_allow_task_nesting = loop->NestableTasksAllowed(); 24 bool did_allow_task_nesting = loop->NestableTasksAllowed();
24 loop->SetNestableTasksAllowed(nestable_tasks_allowed); 25 loop->SetNestableTasksAllowed(nestable_tasks_allowed);
25 26
26 AcceleratorDispatcher dispatcher(nested_dispatcher, associated_window); 27 AcceleratorDispatcher dispatcher(nested_dispatcher, associated_window);
27 28
28 loop->RunWithDispatcher(&dispatcher); 29 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them
30 // use run_loop.QuitClosure().
31 base::RunLoop run_loop(&dispatcher);
32 run_loop.Run();
29 loop->SetNestableTasksAllowed(did_allow_task_nesting); 33 loop->SetNestableTasksAllowed(did_allow_task_nesting);
30 } 34 }
31 35
32 } // namespace ash 36 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/drag_drop/drag_drop_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698