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

Unified Diff: ash/accelerators/nested_dispatcher_controller.cc

Issue 9224001: Fixes issue with accelerators when a menu is open (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as requested Created 8 years, 11 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
Index: ash/accelerators/nested_dispatcher_controller.cc
diff --git a/ash/accelerators/nested_dispatcher_controller.cc b/ash/accelerators/nested_dispatcher_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..747a2cec509ecfcf2a6218ec0f0c830c15d7a1a3
--- /dev/null
+++ b/ash/accelerators/nested_dispatcher_controller.cc
@@ -0,0 +1,28 @@
+// 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 "ash/accelerators/accelerator_dispatcher.h"
+
+namespace ash {
+
+NestedDispatcherController::NestedDispatcherController() {
+ aura::client::SetDispatcherClient(this);
+}
+
+void NestedDispatcherController::RunWithDispatcher(
+ MessageLoop::Dispatcher* nested_dispatcher,
+ bool nestable_tasks_allowed) {
+ MessageLoopForUI* loop = MessageLoopForUI::current();
+ bool did_allow_task_nesting = loop->NestableTasksAllowed();
+ loop->SetNestableTasksAllowed(nestable_tasks_allowed);
+
+ AcceleratorDispatcher dispatcher(nested_dispatcher);
+
+ loop->RunWithDispatcher(&dispatcher);
+ loop->SetNestableTasksAllowed(did_allow_task_nesting);
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698