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

Unified Diff: ui/wm/core/nested_accelerator_dispatcher_win.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_dispatcher_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/nested_accelerator_dispatcher_win.cc
diff --git a/ui/wm/core/nested_accelerator_dispatcher_win.cc b/ui/wm/core/nested_accelerator_dispatcher_win.cc
index a6a5bd9d6642813f583464ad9ae917cfdfb87139..a810bb9d88e85e2d0f83debde81709af37c5d46f 100644
--- a/ui/wm/core/nested_accelerator_dispatcher_win.cc
+++ b/ui/wm/core/nested_accelerator_dispatcher_win.cc
@@ -7,7 +7,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_pump_dispatcher.h"
#include "base/run_loop.h"
+#include "ui/base/accelerators/accelerator.h"
#include "ui/events/event.h"
+#include "ui/wm/core/accelerator_filter.h"
#include "ui/wm/core/nested_accelerator_delegate.h"
using base::MessagePumpDispatcher;
@@ -41,11 +43,16 @@ class NestedAcceleratorDispatcherWin : public NestedAcceleratorDispatcher,
virtual uint32_t Dispatch(const MSG& event) OVERRIDE {
if (IsKeyEvent(event)) {
ui::KeyEvent key_event(event, false);
- if (!delegate_->ShouldProcessEventNow(key_event))
- return POST_DISPATCH_QUIT_LOOP;
-
- if (delegate_->ProcessEvent(key_event))
- return POST_DISPATCH_NONE;
+ ui::Accelerator accelerator = CreateAcceleratorFromKeyEvent(key_event);
+
+ switch (delegate_->ProcessAccelerator(accelerator)) {
+ case NestedAcceleratorDelegate::RESULT_PROCESS_LATER:
+ return POST_DISPATCH_QUIT_LOOP;
+ case NestedAcceleratorDelegate::RESULT_PROCESSED:
+ return POST_DISPATCH_NONE;
+ case NestedAcceleratorDelegate::RESULT_NOT_PROCESSED:
+ break;
+ }
}
return nested_dispatcher_ ? nested_dispatcher_->Dispatch(event)
« no previous file with comments | « ui/wm/core/nested_accelerator_dispatcher_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698