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

Side by Side Diff: ui/wm/core/nested_accelerator_controller.cc

Issue 1647933002: ash/wm: Remove dead code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/wm/core/nested_accelerator_controller.h"
6
7 #include <utility>
8
9 #include "base/auto_reset.h"
10 #include "base/bind.h"
11 #include "base/run_loop.h"
12 #include "ui/wm/core/nested_accelerator_delegate.h"
13 #include "ui/wm/core/nested_accelerator_dispatcher.h"
14
15 namespace wm {
16
17 NestedAcceleratorController::NestedAcceleratorController(
18 NestedAcceleratorDelegate* delegate)
19 : dispatcher_delegate_(delegate) {
20 DCHECK(delegate);
21 }
22
23 NestedAcceleratorController::~NestedAcceleratorController() {
24 }
25
26 void NestedAcceleratorController::PrepareNestedLoopClosures(
27 base::MessagePumpDispatcher* nested_dispatcher,
28 base::Closure* run_closure,
29 base::Closure* quit_closure) {
30 scoped_ptr<NestedAcceleratorDispatcher> old_accelerator_dispatcher =
31 std::move(accelerator_dispatcher_);
32 accelerator_dispatcher_ = NestedAcceleratorDispatcher::Create(
33 dispatcher_delegate_.get(), nested_dispatcher);
34
35 scoped_ptr<base::RunLoop> run_loop = accelerator_dispatcher_->CreateRunLoop();
36 *quit_closure =
37 base::Bind(&NestedAcceleratorController::QuitNestedMessageLoop,
38 base::Unretained(this),
39 run_loop->QuitClosure());
40 *run_closure = base::Bind(&NestedAcceleratorController::RunNestedMessageLoop,
41 base::Unretained(this),
42 base::Passed(&run_loop),
43 base::Passed(&old_accelerator_dispatcher));
44 }
45
46 void NestedAcceleratorController::RunNestedMessageLoop(
47 scoped_ptr<base::RunLoop> run_loop,
48 scoped_ptr<NestedAcceleratorDispatcher> old_accelerator_dispatcher) {
49 run_loop->Run();
50 accelerator_dispatcher_ = std::move(old_accelerator_dispatcher);
51 }
52
53 void NestedAcceleratorController::QuitNestedMessageLoop(
54 const base::Closure& quit_runloop) {
55 quit_runloop.Run();
56 accelerator_dispatcher_.reset();
57 }
58
59 } // namespace wm
OLDNEW
« no previous file with comments | « ui/wm/core/nested_accelerator_controller.h ('k') | ui/wm/core/nested_accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698