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

Unified Diff: chrome/browser/ui/cocoa/base_bubble_controller.mm

Issue 13160004: Re-implement form validation message UI with native widgets. (Common and Mac) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adddress review comments, and add a test Created 7 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
Index: chrome/browser/ui/cocoa/base_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm
index 375cb136a9c56222bcd11fb786783eb570941ebd..e81ce657d2b7ce86f6b15bc2e29a406c20651b89 100644
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm
@@ -28,6 +28,7 @@
@synthesize parentWindow = parentWindow_;
@synthesize anchorPoint = anchor_;
@synthesize bubble = bubble_;
+@synthesize shouldOpenAsKeyWindow = shouldOpenAsKeyWindow_;
- (id)initWithWindowNibPath:(NSString*)nibPath
parentWindow:(NSWindow*)parentWindow
@@ -44,6 +45,7 @@
selector:@selector(parentWindowWillClose:)
name:NSWindowWillCloseNotification
object:parentWindow_];
+ shouldOpenAsKeyWindow_ = YES;
}
return self;
}
@@ -86,6 +88,7 @@
object:parentWindow_];
[self awakeFromNib];
+ shouldOpenAsKeyWindow_ = YES;
Nico 2013/04/29 22:35:48 (likewise; probably at least want to do this befor
tkent 2013/04/29 23:08:01 Done.
}
return self;
}
@@ -148,7 +151,10 @@
NSWindow* window = [self window]; // Completes nib load.
[self updateOriginFromAnchor];
[parentWindow_ addChildWindow:window ordered:NSWindowAbove];
- [window makeKeyAndOrderFront:self];
+ if (shouldOpenAsKeyWindow_)
+ [window makeKeyAndOrderFront:self];
+ else
+ [window orderFront:nil];
[self registerKeyStateEventTap];
}

Powered by Google App Engine
This is Rietveld 408576698