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/page_info_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/page_info_bubble_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 @implementation PageInfoBubbleController | 176 @implementation PageInfoBubbleController |
177 | 177 |
178 @synthesize certID = certID_; | 178 @synthesize certID = certID_; |
179 | 179 |
180 - (id)initWithPageInfoModel:(PageInfoModel*)model | 180 - (id)initWithPageInfoModel:(PageInfoModel*)model |
181 modelObserver:(PageInfoModelObserver*)bridge | 181 modelObserver:(PageInfoModelObserver*)bridge |
182 parentWindow:(NSWindow*)parentWindow { | 182 parentWindow:(NSWindow*)parentWindow { |
183 DCHECK(parentWindow); | 183 DCHECK(parentWindow); |
184 | 184 |
185 // Use an arbitrary height because it will be changed by the bridge. | 185 // Use an arbitrary height because it will be changed by the bridge. |
186 NSRect contentRect = NSMakeRect(0, 0, kWindowWidth, 0); | 186 NSRect contentRect = NSMakeRect(0, 0, kWindowWidth, 1); |
187 // Create an empty window into which content is placed. | 187 // Create an empty window into which content is placed. |
188 scoped_nsobject<InfoBubbleWindow> window( | 188 scoped_nsobject<InfoBubbleWindow> window( |
189 [[InfoBubbleWindow alloc] initWithContentRect:contentRect | 189 [[InfoBubbleWindow alloc] initWithContentRect:contentRect |
190 styleMask:NSBorderlessWindowMask | 190 styleMask:NSBorderlessWindowMask |
191 backing:NSBackingStoreBuffered | 191 backing:NSBackingStoreBuffered |
192 defer:NO]); | 192 defer:NO]); |
193 | 193 |
194 if ((self = [super initWithWindow:window.get() | 194 if ((self = [super initWithWindow:window.get() |
195 parentWindow:parentWindow | 195 parentWindow:parentWindow |
196 anchoredAt:NSZeroPoint])) { | 196 anchoredAt:NSZeroPoint])) { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 LocationBarViewMac* locationBar = [controller locationBarBridge]; | 475 LocationBarViewMac* locationBar = [controller locationBarBridge]; |
476 if (locationBar) { | 476 if (locationBar) { |
477 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); | 477 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); |
478 origin = [parent convertBaseToScreen:bubblePoint]; | 478 origin = [parent convertBaseToScreen:bubblePoint]; |
479 } | 479 } |
480 } | 480 } |
481 return origin; | 481 return origin; |
482 } | 482 } |
483 | 483 |
484 @end | 484 @end |
OLD | NEW |