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/page_info_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/page_info_bubble_controller.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "base/task.h" | 10 #include "base/task.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 offset += [self addHelpButtonToSubviews:subviews atOffset:offset]; | 281 offset += [self addHelpButtonToSubviews:subviews atOffset:offset]; |
282 | 282 |
283 // Add the bottom padding. | 283 // Add the bottom padding. |
284 offset += kVerticalSpacing; | 284 offset += kVerticalSpacing; |
285 | 285 |
286 // Create the dummy view that uses flipped coordinates. | 286 // Create the dummy view that uses flipped coordinates. |
287 NSRect contentFrame = NSMakeRect(0, 0, kWindowWidth, offset); | 287 NSRect contentFrame = NSMakeRect(0, 0, kWindowWidth, offset); |
288 scoped_nsobject<PageInfoContentView> contentView( | 288 scoped_nsobject<PageInfoContentView> contentView( |
289 [[PageInfoContentView alloc] initWithFrame:contentFrame]); | 289 [[PageInfoContentView alloc] initWithFrame:contentFrame]); |
290 [contentView setSubviews:subviews]; | 290 [contentView setSubviews:subviews]; |
| 291 [contentView setAutoresizingMask:NSViewMinYMargin]; |
291 | 292 |
292 NSRect windowFrame = NSMakeRect(0, 0, kWindowWidth, offset); | 293 NSRect windowFrame = NSMakeRect(0, 0, kWindowWidth, offset); |
293 windowFrame.size = [[[self window] contentView] convertSize:windowFrame.size | 294 windowFrame.size = [[[self window] contentView] convertSize:windowFrame.size |
294 toView:nil]; | 295 toView:nil]; |
295 // Adjust the origin by the difference in height. | 296 // Adjust the origin by the difference in height. |
296 windowFrame.origin = [[self window] frame].origin; | 297 windowFrame.origin = [[self window] frame].origin; |
297 windowFrame.origin.y -= NSHeight(windowFrame) - | 298 windowFrame.origin.y -= NSHeight(windowFrame) - |
298 NSHeight([[self window] frame]); | 299 NSHeight([[self window] frame]); |
299 | 300 |
300 // Resize the window. Only animate if the window is visible, otherwise it | 301 // Resize the window. Only animate if the window is visible, otherwise it |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 LocationBarViewMac* locationBar = [controller locationBarBridge]; | 471 LocationBarViewMac* locationBar = [controller locationBarBridge]; |
471 if (locationBar) { | 472 if (locationBar) { |
472 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); | 473 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); |
473 origin = [parent convertBaseToScreen:bubblePoint]; | 474 origin = [parent convertBaseToScreen:bubblePoint]; |
474 } | 475 } |
475 } | 476 } |
476 return origin; | 477 return origin; |
477 } | 478 } |
478 | 479 |
479 @end | 480 @end |
OLD | NEW |