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

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

Issue 573143002: Mac: Give bubble windows an initial position before showing them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm » ('j') | 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 DCHECK(![[self window] delegate]); 79 DCHECK(![[self window] delegate]);
80 [theWindow setDelegate:self]; 80 [theWindow setDelegate:self];
81 81
82 base::scoped_nsobject<InfoBubbleView> contentView( 82 base::scoped_nsobject<InfoBubbleView> contentView(
83 [[InfoBubbleView alloc] initWithFrame:NSZeroRect]); 83 [[InfoBubbleView alloc] initWithFrame:NSZeroRect]);
84 [theWindow setContentView:contentView.get()]; 84 [theWindow setContentView:contentView.get()];
85 bubble_ = contentView.get(); 85 bubble_ = contentView.get();
86 86
87 [self registerForNotifications]; 87 [self registerForNotifications];
88 [self awakeFromNib]; 88 [self awakeFromNib];
89 [self updateOriginFromAnchor];
Robert Sesek 2014/09/17 16:52:48 Why not do [self setAnchorPoint:] instead?
tapted 2014/09/18 02:58:22 Done. The nib codepaths complicate things a bit -
89 } 90 }
90 return self; 91 return self;
91 } 92 }
92 93
93 - (void)awakeFromNib { 94 - (void)awakeFromNib {
94 // Check all connections have been made in Interface Builder. 95 // Check all connections have been made in Interface Builder.
95 DCHECK([self window]); 96 DCHECK([self window]);
96 DCHECK(bubble_); 97 DCHECK(bubble_);
97 DCHECK_EQ(self, [[self window] delegate]); 98 DCHECK_EQ(self, [[self window] delegate]);
98 99
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 369
369 - (void)activateTabWithContents:(content::WebContents*)newContents 370 - (void)activateTabWithContents:(content::WebContents*)newContents
370 previousContents:(content::WebContents*)oldContents 371 previousContents:(content::WebContents*)oldContents
371 atIndex:(NSInteger)index 372 atIndex:(NSInteger)index
372 reason:(int)reason { 373 reason:(int)reason {
373 // The user switched tabs; close. 374 // The user switched tabs; close.
374 [self close]; 375 [self close];
375 } 376 }
376 377
377 @end // BaseBubbleController 378 @end // BaseBubbleController
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698