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

Unified Diff: chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm

Issue 265693009: Makes permission bubble properly handle browser-type keyboard events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
index 92c8fc58ea12a55a9bc97a13fa81cade44cb34f9..cd03d37dfb08650b8c71e589a9fd6073a681d695 100644
--- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
@@ -127,6 +127,21 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate {
@end
+// The window used for the permission bubble controller.
+// Subclassed to allow browser-handled keyboard events to be passed from the
+// permission bubble to its parent window, which is a browser window.
groby-ooo-7-16 2014/05/02 01:43:25 If the parent window is a browser window, I believ
leng 2014/05/02 16:24:58 Thanks, done.
+@interface PermissionBubbleWindow : InfoBubbleWindow
+@end
+
+@implementation PermissionBubbleWindow
+- (BOOL)performKeyEquivalent:(NSEvent*)event {
+ ChromeEventProcessingWindow* eventWindow =
+ base::mac::ObjCCastStrict<ChromeEventProcessingWindow>(
+ [self parentWindow]);
+ return [eventWindow performKeyEquivalent:event];
+}
+@end
+
@interface PermissionBubbleController ()
// Returns an autoreleased NSView displaying the icon and label for |request|.
@@ -190,11 +205,12 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate {
bridge:(PermissionBubbleCocoa*)bridge {
DCHECK(parentWindow);
DCHECK(bridge);
- base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc]
- initWithContentRect:ui::kWindowSizeDeterminedLater
- styleMask:NSBorderlessWindowMask
- backing:NSBackingStoreBuffered
- defer:NO]);
+ base::scoped_nsobject<PermissionBubbleWindow> window(
+ [[PermissionBubbleWindow alloc]
+ initWithContentRect:ui::kWindowSizeDeterminedLater
+ styleMask:NSBorderlessWindowMask
+ backing:NSBackingStoreBuffered
+ defer:NO]);
[window setAllowedAnimations:info_bubble::kAnimateNone];
if ((self = [super initWithWindow:window
parentWindow:parentWindow
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698