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

Side by Side Diff: chrome/browser/ui/cocoa/base_bubble_controller.mm

Issue 68733003: Fix BaseBubbleController default behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 22 matching lines...) Expand all
33 33
34 - (id)initWithWindowNibPath:(NSString*)nibPath 34 - (id)initWithWindowNibPath:(NSString*)nibPath
35 parentWindow:(NSWindow*)parentWindow 35 parentWindow:(NSWindow*)parentWindow
36 anchoredAt:(NSPoint)anchoredAt { 36 anchoredAt:(NSPoint)anchoredAt {
37 nibPath = [base::mac::FrameworkBundle() pathForResource:nibPath 37 nibPath = [base::mac::FrameworkBundle() pathForResource:nibPath
38 ofType:@"nib"]; 38 ofType:@"nib"];
39 if ((self = [super initWithWindowNibPath:nibPath owner:self])) { 39 if ((self = [super initWithWindowNibPath:nibPath owner:self])) {
40 parentWindow_ = parentWindow; 40 parentWindow_ = parentWindow;
41 anchor_ = anchoredAt; 41 anchor_ = anchoredAt;
42 shouldOpenAsKeyWindow_ = YES; 42 shouldOpenAsKeyWindow_ = YES;
43 shouldCloseOnResignKey_ = YES;
43 44
44 // Watch to see if the parent window closes, and if so, close this one. 45 // Watch to see if the parent window closes, and if so, close this one.
45 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; 46 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
46 [center addObserver:self 47 [center addObserver:self
47 selector:@selector(parentWindowWillClose:) 48 selector:@selector(parentWindowWillClose:)
48 name:NSWindowWillCloseNotification 49 name:NSWindowWillCloseNotification
49 object:parentWindow_]; 50 object:parentWindow_];
50 } 51 }
51 return self; 52 return self;
52 } 53 }
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 287
287 - (void)activateTabWithContents:(content::WebContents*)newContents 288 - (void)activateTabWithContents:(content::WebContents*)newContents
288 previousContents:(content::WebContents*)oldContents 289 previousContents:(content::WebContents*)oldContents
289 atIndex:(NSInteger)index 290 atIndex:(NSInteger)index
290 reason:(int)reason { 291 reason:(int)reason {
291 // The user switched tabs; close. 292 // The user switched tabs; close.
292 [self close]; 293 [self close];
293 } 294 }
294 295
295 @end // BaseBubbleController 296 @end // BaseBubbleController
OLDNEW
« 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