summaryrefslogtreecommitdiffstats
path: root/athena
diff options
context:
space:
mode:
authorpkotwicz <pkotwicz@chromium.org>2014-11-24 08:31:23 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-24 16:31:41 +0000
commit949808bf24762b9c5d3697c4eaa30857917a2a0b (patch)
tree0cb1bc2b259de47c9a58a727a5d027bf94e020c9 /athena
parent570b8a48b2889c159d8e8037e6c2d8edd6c33b0a (diff)
downloadchromium_src-949808bf24762b9c5d3697c4eaa30857917a2a0b.zip
chromium_src-949808bf24762b9c5d3697c4eaa30857917a2a0b.tar.gz
chromium_src-949808bf24762b9c5d3697c4eaa30857917a2a0b.tar.bz2
Fix blocking of non-repeatable accelerators
This CL makes ui::EF_IS_REPEAT get propagated to AcceleratorController. In particular, this CL: - preserves ui::EF_IS_REPEAT when converting from ui::KeyEvent -> content::NativeWebKeyboardEvent -> ui::KeyEvent - preserves ui::EF_IS_REPEAT when remapping accelerator via ImeControlDelegate::RemapAccelerator() BUG=434743 TEST=AcceleratorControllerBrowserTest.RepeatedToggleMaximizeViaAccelerator Review URL: https://codereview.chromium.org/735943002 Cr-Commit-Position: refs/heads/master@{#305434}
Diffstat (limited to 'athena')
-rw-r--r--athena/athena.gyp1
-rw-r--r--athena/content/DEPS1
-rw-r--r--athena/content/web_activity.cc9
3 files changed, 5 insertions, 6 deletions
diff --git a/athena/athena.gyp b/athena/athena.gyp
index 9292d25..2c4679d 100644
--- a/athena/athena.gyp
+++ b/athena/athena.gyp
@@ -145,6 +145,7 @@
'../extensions/extensions.gyp:extensions_browser',
'../extensions/extensions.gyp:extensions_common',
'../ui/app_list/app_list.gyp:app_list',
+ '../ui/content_accelerators/ui_content_accelerators.gyp:ui_content_accelerators',
'../ui/keyboard/keyboard.gyp:keyboard',
'../ui/keyboard/keyboard.gyp:keyboard_resources',
'../third_party/WebKit/public/blink.gyp:blink',
diff --git a/athena/content/DEPS b/athena/content/DEPS
index a8151cd..244ac1a 100644
--- a/athena/content/DEPS
+++ b/athena/content/DEPS
@@ -16,6 +16,7 @@ include_rules = [
"+ui/aura",
"+ui/base",
"+ui/compositor",
+ "+ui/content_accelerators",
"+ui/gfx",
"+ui/views",
"+ui/wm/core",
diff --git a/athena/content/web_activity.cc b/athena/content/web_activity.cc
index cc4928a..d5f1c29 100644
--- a/athena/content/web_activity.cc
+++ b/athena/content/web_activity.cc
@@ -18,7 +18,6 @@
#include "base/strings/utf_string_conversions.h"
#include "components/app_modal/javascript_dialog_manager.h"
#include "components/favicon_base/select_favicon_frames.h"
-#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -28,6 +27,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/compositor/closure_animation_observer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
+#include "ui/content_accelerators/accelerator_util.h"
#include "ui/views/background.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
@@ -84,11 +84,8 @@ class WebActivityController : public AcceleratorHandler {
bool PreHandleKeyboardEvent(content::WebContents* source,
const content::NativeWebKeyboardEvent& event,
bool* is_keyboard_shortcut) {
- ui::Accelerator accelerator(
- static_cast<ui::KeyboardCode>(event.windowsKeyCode),
- content::GetModifiersFromNativeWebKeyboardEvent(event));
- if (event.type == blink::WebInputEvent::KeyUp)
- accelerator.set_type(ui::ET_KEY_RELEASED);
+ ui::Accelerator accelerator =
+ ui::GetAcceleratorFromNativeWebKeyboardEvent(event);
if (reserved_accelerator_enabled_ &&
accelerator_manager_->IsRegistered(accelerator, AF_RESERVED)) {