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

Unified Diff: ui/views/cocoa/bridged_content_view.mm

Issue 1393233002: Mac Energy Test Harness/Framework Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Snapshot of scripts for http://crbug.com/391646 Created 5 years, 2 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/cocoa/bridged_content_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_content_view.mm
diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm
index 43a95a873bec0735900f429cd1f7069a307ea6ed..38a573ee873ab4b101b6a46d36a97101a5594b74 100644
--- a/ui/views/cocoa/bridged_content_view.mm
+++ b/ui/views/cocoa/bridged_content_view.mm
@@ -171,6 +171,8 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
return;
DCHECK(theEvent);
+ DCHECK_NE(NSApplicationDefined, [theEvent type]);
+
ui::KeyEvent event(theEvent);
if (DispatchEventToMenu(hostedView_->GetWidget(), event.key_code()))
return;
@@ -346,9 +348,9 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
- (void)keyDown:(NSEvent*)theEvent {
// Convert the event into an action message, according to OSX key mappings.
- inKeyDown_ = YES;
+ inKeyDown_.reset([theEvent retain]);
[self interpretKeyEvents:@[ theEvent ]];
- inKeyDown_ = NO;
+ inKeyDown_.reset();
}
- (void)scrollWheel:(NSEvent*)theEvent {
@@ -580,7 +582,7 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
// Like the renderer, handle insert action messages as a regular key dispatch.
// This ensures, e.g., insertTab correctly changes focus between fields.
if (inKeyDown_ && [NSStringFromSelector(selector) hasPrefix:@"insert"]) {
- [self handleKeyEvent:[NSApp currentEvent]];
+ [self handleKeyEvent:inKeyDown_];
return;
}
« no previous file with comments | « ui/views/cocoa/bridged_content_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698