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

Unified Diff: ash/accelerators/ash_menu_event_filter_delegate.cc

Issue 1138523006: Enable keyboard accelerators while a menu is open (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 5 years, 4 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/ash_menu_event_filter_delegate.cc
diff --git a/ash/accelerators/ash_menu_event_filter_delegate.cc b/ash/accelerators/ash_menu_event_filter_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..512032f75f168218e6a1f83864c786f81797194a
--- /dev/null
+++ b/ash/accelerators/ash_menu_event_filter_delegate.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 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/ash_menu_event_filter_delegate.h"
+
+#include "ash/accelerators/accelerator_controller.h"
+#include "ash/shell.h"
+#include "ui/views/controls/menu/menu_event_filter.h"
+
+namespace ash {
+
+AshMenuEventFilterDelegate::AshMenuEventFilterDelegate() {}
+AshMenuEventFilterDelegate::~AshMenuEventFilterDelegate() {}
+
+void AshMenuEventFilterDelegate::StoreInHistory(
+ const ui::Accelerator& accelerator) {
+ Shell::GetInstance()
+ ->accelerator_controller()
+ ->accelerator_history()
+ ->StoreCurrentAccelerator(accelerator);
+}
+
+bool AshMenuEventFilterDelegate::ShouldCloseMenuAndRepostAccelerator(
+ const ui::Accelerator& accelerator) const {
+ return Shell::GetInstance()
+ ->accelerator_controller()
+ ->ShouldCloseMenuAndRepostAccelerator(accelerator);
+}
+
+void AshMenuEventFilterDelegate::ProcessAcceleratorNow(
+ const ui::Accelerator& accelerator) {
+ Shell::GetInstance()->accelerator_controller()->Process(accelerator);
+}
+
+} // namespace ash
« no previous file with comments | « ash/accelerators/ash_menu_event_filter_delegate.h ('k') | ash/ash.gyp » ('j') | ash/shell.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698