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

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

Issue 312483002: More accelerator code leanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_delegate.h ('k') | ui/wm/core/nested_accelerator_dispatcher_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/nested_accelerator_dispatcher_linux.cc
diff --git a/ui/wm/core/nested_accelerator_dispatcher_linux.cc b/ui/wm/core/nested_accelerator_dispatcher_linux.cc
index bf21d3f9ff5a3931ef9ab15ff87990d06cd3b05f..12340b66a7bf3c1a87e0e885af68ac7cb2f1f177 100644
--- a/ui/wm/core/nested_accelerator_dispatcher_linux.cc
+++ b/ui/wm/core/nested_accelerator_dispatcher_linux.cc
@@ -6,10 +6,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
+#include "ui/base/accelerators/accelerator.h"
#include "ui/events/event.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/events/platform/scoped_event_dispatcher.h"
+#include "ui/wm/core/accelerator_filter.h"
#include "ui/wm/core/nested_accelerator_delegate.h"
#if defined(USE_X11)
@@ -65,17 +67,21 @@ class NestedAcceleratorDispatcherLinux : public NestedAcceleratorDispatcher,
virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
if (IsKeyEvent(event)) {
ui::KeyEvent key_event(event, false);
- if (!delegate_->ShouldProcessEventNow(key_event)) {
+ ui::Accelerator accelerator = CreateAcceleratorFromKeyEvent(key_event);
+
+ switch (delegate_->ProcessAccelerator(accelerator)) {
+ case NestedAcceleratorDelegate::RESULT_PROCESS_LATER:
#if defined(USE_X11)
- XPutBackEvent(event->xany.display, event);
+ XPutBackEvent(event->xany.display, event);
#else
- NOTIMPLEMENTED();
+ NOTIMPLEMENTED();
#endif
- return ui::POST_DISPATCH_NONE;
+ return ui::POST_DISPATCH_NONE;
+ case NestedAcceleratorDelegate::RESULT_PROCESSED:
+ return ui::POST_DISPATCH_NONE;
+ case NestedAcceleratorDelegate::RESULT_NOT_PROCESSED:
+ break;
}
-
- if (delegate_->ProcessEvent(key_event))
- return ui::POST_DISPATCH_NONE;
}
ui::PlatformEventDispatcher* prev = *restore_dispatcher_;
« no previous file with comments | « ui/wm/core/nested_accelerator_delegate.h ('k') | ui/wm/core/nested_accelerator_dispatcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698