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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

Issue 303002: Make window cycling work even if you change it to something else than cmd-` in sysprefs. (Closed)
Patch Set: Fix spelling. Created 11 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
Index: chrome/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index 7709790ee5aae8732aaa07e2ba863d258f52aae3..f0d004f869ec8ea2dc06d1e744e5960316634ce2 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -536,7 +536,14 @@ void RenderWidgetHostViewMac::SetBackground(const SkBitmap& background) {
renderWidgetHostView_->render_widget_host_->ForwardMouseEvent(event);
}
+- (void)setIgnoreKeyEvents:(BOOL)ignorekeyEvents {
+ ignoreKeyEvents_ = ignorekeyEvents;
+}
+
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent {
+ if (ignoreKeyEvents_)
+ return NO;
+
// We have some magic in |CrApplication sendEvent:| that always sends key
// events to |keyEvent:| so that cocoa doesn't have a chance to intercept it.
DCHECK([[self window] firstResponder] != self);
@@ -544,6 +551,9 @@ void RenderWidgetHostViewMac::SetBackground(const SkBitmap& background) {
}
- (void)keyEvent:(NSEvent*)theEvent {
+ if (ignoreKeyEvents_)
+ return;
+
// TODO(avi): Possibly kill self? See RenderWidgetHostViewWin::OnKeyEvent and
// http://b/issue?id=1192881 .

Powered by Google App Engine
This is Rietveld 408576698