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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

Issue 7634028: Only check the keycode for key events. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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 | « no previous file | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
index e008d3d79c9b0287ac557ccaeb34dd3c7a3eda80..44ce222b0e321a8aa72d68ee55aeef3e595e8af4 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -846,7 +846,9 @@ bool OmniboxViewMac::OnDoCommandBySelector(SEL cmd) {
// behavior with the proper WindowOpenDisposition.
NSEvent* event = [NSApp currentEvent];
if (cmd == @selector(insertNewline:) ||
- (cmd == @selector(noop:) && [event keyCode] == kVK_Return)) {
+ (cmd == @selector(noop:) &&
+ ([event type] == NSKeyDown || [event type] == NSKeyUp) &&
+ [event keyCode] == kVK_Return)) {
WindowOpenDisposition disposition =
event_utils::WindowOpenDispositionFromNSEvent(event);
model_->AcceptInput(disposition, false);
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698