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

Unified Diff: ui/wm/core/nested_accelerator_controller.cc

Issue 298703007: Refactor and move ash independent nested accelerator code to ui/wm/core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: skip test if platform does not support PES Created 6 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/nested_accelerator_controller.cc
diff --git a/ash/accelerators/nested_dispatcher_controller.cc b/ui/wm/core/nested_accelerator_controller.cc
similarity index 54%
rename from ash/accelerators/nested_dispatcher_controller.cc
rename to ui/wm/core/nested_accelerator_controller.cc
index 2a90025ee26dbcab9ee1d4f26dd4fb6d1ddb4868..555b83093768640fad07c1c864e4d924ce551eb5 100644
--- a/ash/accelerators/nested_dispatcher_controller.cc
+++ b/ui/wm/core/nested_accelerator_controller.cc
@@ -1,30 +1,34 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/accelerators/nested_dispatcher_controller.h"
+#include "ui/wm/core/nested_accelerator_controller.h"
-#include "ash/accelerators/accelerator_dispatcher.h"
-#include "ash/shell.h"
#include "base/auto_reset.h"
#include "base/run_loop.h"
+#include "ui/wm/core/nested_accelerator_delegate.h"
+#include "ui/wm/core/nested_accelerator_dispatcher.h"
-namespace ash {
+namespace wm {
-NestedDispatcherController::NestedDispatcherController() {
+NestedAcceleratorController::NestedAcceleratorController(
+ NestedAcceleratorDelegate* delegate)
+ : dispatcher_delegate_(delegate) {
+ DCHECK(delegate);
}
-NestedDispatcherController::~NestedDispatcherController() {
+NestedAcceleratorController::~NestedAcceleratorController() {
}
-void NestedDispatcherController::RunWithDispatcher(
+void NestedAcceleratorController::RunWithDispatcher(
base::MessagePumpDispatcher* nested_dispatcher) {
base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
- scoped_ptr<AcceleratorDispatcher> old_accelerator_dispatcher =
+ scoped_ptr<NestedAcceleratorDispatcher> old_accelerator_dispatcher =
accelerator_dispatcher_.Pass();
- accelerator_dispatcher_ = AcceleratorDispatcher::Create(nested_dispatcher);
+ accelerator_dispatcher_ = NestedAcceleratorDispatcher::Create(
+ dispatcher_delegate_.get(), nested_dispatcher);
// TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them
// use run_loop.QuitClosure().
@@ -35,10 +39,10 @@ void NestedDispatcherController::RunWithDispatcher(
accelerator_dispatcher_ = old_accelerator_dispatcher.Pass();
}
-void NestedDispatcherController::QuitNestedMessageLoop() {
+void NestedAcceleratorController::QuitNestedMessageLoop() {
CHECK(!quit_closure_.is_null());
quit_closure_.Run();
accelerator_dispatcher_.reset();
}
-} // namespace ash
+} // namespace wm
« 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