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

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: 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..55b976ae5f8d2f023c2358d2ceb72f22b82aef50 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
@@ -37,6 +38,7 @@
if ((self = [super initWithWindowNibPath:nibPath owner:self])) {
parentWindow_ = parentWindow;
anchor_ = anchoredAt;
+ shouldOpenAsKeyWindow_ = YES;
// Watch to see if the parent window closes, and if so, close this one.
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
@@ -69,6 +71,7 @@
if ((self = [super initWithWindow:theWindow])) {
parentWindow_ = parentWindow;
anchor_ = anchoredAt;
+ shouldOpenAsKeyWindow_ = YES;
DCHECK(![[self window] delegate]);
[theWindow setDelegate: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];
}
« no previous file with comments | « chrome/browser/ui/cocoa/base_bubble_controller.h ('k') | chrome/browser/ui/cocoa/validation_message_bubble_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698