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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 10381145: WIP: Always update ui::AcceleratorManager Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 5 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/focus/focus_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index dc2f44152ea1d76183da549ad188e5a5e6b42fed..c46c4e6aaf64abd2fbebf3d9b16fbd32b054667f 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -21,6 +21,7 @@
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
+#include "ui/base/accelerators/accelerator.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/ui_base_types.h"
#include "ui/compositor/layer.h"
@@ -691,9 +692,17 @@ void NativeWidgetAura::DispatchKeyEventPostIME(const KeyEvent& key) {
FocusManager* focus_manager = GetWidget()->GetFocusManager();
if (focus_manager)
focus_manager->MaybeResetMenuKeyState(key);
- if (delegate_->OnKeyEvent(key) || !focus_manager)
+ const bool consumed = delegate_->OnKeyEvent(key);
+ if (!consumed && focus_manager)
+ focus_manager->OnKeyEvent(key);
+ if (!focus_manager)
return;
- focus_manager->OnKeyEvent(key);
+ ui::Accelerator accelerator(key.key_code(),
+ key.IsShiftDown(),
+ key.IsControlDown(),
+ key.IsAltDown());
+ accelerator.set_type(key.type());
+ focus_manager->accelerator_manager()->set_last_event(accelerator);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/views/focus/focus_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698