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

Unified Diff: ui/views/views_delegate.h

Issue 1138523006: Enable keyboard accelerators while a menu is open (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed OnTouchEvent() Created 5 years, 3 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/views/views.gyp ('k') | ui/views/views_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/views_delegate.h
diff --git a/ui/views/views_delegate.h b/ui/views/views_delegate.h
index e2f33b05caa5e032b7575788c8e6b364d7b61e6d..c881daab09f34eae37173da7ee7d292af26f5fe4 100644
--- a/ui/views/views_delegate.h
+++ b/ui/views/views_delegate.h
@@ -73,6 +73,16 @@ class VIEWS_EXPORT ViewsDelegate {
};
#endif
+ enum class ProcessMenuAcceleratorResult {
+ // The accelerator was handled while the menu was showing. No further action
+ // is needed and the menu should be kept open.
+ LEAVE_MENU_OPEN,
+
+ // The accelerator was not handled. Menu should be closed and the
+ // accelerator will be reposted to be handled after the menu closes.
+ CLOSE_MENU
+ };
+
virtual ~ViewsDelegate();
// Returns the ViewsDelegate instance if there is one, or nullptr otherwise.
@@ -102,6 +112,13 @@ class VIEWS_EXPORT ViewsDelegate {
int item_count,
bool has_submenu);
+ // If |accelerator| can be processed while a menu is showing, it will be
+ // processed now and LEAVE_MENU_OPEN is returned. Otherwise, |accelerator|
+ // will be reposted for processing later after the menu closes and CLOSE_MENU
+ // will be returned.
+ virtual ProcessMenuAcceleratorResult ProcessAcceleratorWhileMenuShowing(
+ const ui::Accelerator& accelerator);
+
#if defined(OS_WIN)
// Retrieves the default window icon to use for windows if none is specified.
virtual HICON GetDefaultWindowIcon() const;
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698