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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 10446010: wip: Add ui::EventType parameter. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wip - views_unittests Created 8 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 | « chrome/browser/ui/views/find_bar_host.cc ('k') | chrome/browser/ui/views/fullscreen_exit_bubble_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 004560b51256321a1f72d8887d347a968904c514..a54ccfffc32efc43da9ea4bc090d37e83370b048 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -471,13 +471,16 @@ bool BrowserView::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) {
// anywhere so we need to check for them explicitly here.
switch (cmd_id) {
case IDC_CUT:
- *accelerator = ui::Accelerator(ui::VKEY_X, ui::EF_CONTROL_DOWN);
+ *accelerator =
+ ui::Accelerator(ui::VKEY_X, ui::EF_CONTROL_DOWN, ui::ET_KEY_PRESSED);
return true;
case IDC_COPY:
- *accelerator = ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN);
+ *accelerator =
+ ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN, ui::ET_KEY_PRESSED);
return true;
case IDC_PASTE:
- *accelerator = ui::Accelerator(ui::VKEY_V, ui::EF_CONTROL_DOWN);
+ *accelerator =
+ ui::Accelerator(ui::VKEY_V, ui::EF_CONTROL_DOWN, ui::ET_KEY_PRESSED);
return true;
}
// Else, we retrieve the accelerator information from the accelerator table.
@@ -1178,9 +1181,9 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
ui::Accelerator accelerator(
static_cast<ui::KeyboardCode>(event.windowsKeyCode),
- content::GetModifiersFromNativeWebKeyboardEvent(event));
- if (event.type == WebKit::WebInputEvent::KeyUp)
- accelerator.set_type(ui::ET_KEY_RELEASED);
+ content::GetModifiersFromNativeWebKeyboardEvent(event),
+ (event.type == WebKit::WebInputEvent::KeyUp) ?
+ ui::ET_KEY_RELEASED : ui::ET_KEY_PRESSED);
// What we have to do here is as follows:
// - If the |browser_| is for an app, do nothing.
@@ -2170,7 +2173,8 @@ void BrowserView::LoadAccelerators() {
// Let's fill our own accelerator table.
for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) {
ui::Accelerator accelerator(browser::kAcceleratorMap[i].keycode,
- browser::kAcceleratorMap[i].modifiers);
+ browser::kAcceleratorMap[i].modifiers,
+ ui::ET_KEY_PRESSED);
accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id;
// Also register with the focus manager.
« no previous file with comments | « chrome/browser/ui/views/find_bar_host.cc ('k') | chrome/browser/ui/views/fullscreen_exit_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698