OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 return self; | 113 return self; |
114 } | 114 } |
115 | 115 |
116 - (void)awakeFromNib { | 116 - (void)awakeFromNib { |
117 // Check all connections have been made in Interface Builder. | 117 // Check all connections have been made in Interface Builder. |
118 DCHECK([self window]); | 118 DCHECK([self window]); |
119 DCHECK(bubble_); | 119 DCHECK(bubble_); |
120 DCHECK_EQ(self, [[self window] delegate]); | 120 DCHECK_EQ(self, [[self window] delegate]); |
121 | 121 |
122 base_bridge_.reset(new BaseBubbleControllerInternal::Bridge(self)); | 122 baseBridge_.reset(new BaseBubbleControllerInternal::Bridge(self)); |
123 | 123 |
124 [bubble_ setArrowLocation:info_bubble::kTopRight]; | 124 [bubble_ setArrowLocation:info_bubble::kTopRight]; |
125 } | 125 } |
126 | 126 |
127 - (void)dealloc { | 127 - (void)dealloc { |
128 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 128 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
129 [super dealloc]; | 129 [super dealloc]; |
130 } | 130 } |
131 | 131 |
132 - (void)setAnchorPoint:(NSPoint)anchor { | 132 - (void)setAnchorPoint:(NSPoint)anchor { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 default: | 223 default: |
224 NOTREACHED(); | 224 NOTREACHED(); |
225 } | 225 } |
226 | 226 |
227 origin.y -= NSHeight([window frame]); | 227 origin.y -= NSHeight([window frame]); |
228 [window setFrameOrigin:origin]; | 228 [window setFrameOrigin:origin]; |
229 } | 229 } |
230 | 230 |
231 @end // BaseBubbleController | 231 @end // BaseBubbleController |
OLD | NEW |