Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |