| 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/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // use arbitrary values. | 375 // use arbitrary values. |
| 376 NSRect frame = NSMakeRect(kTextXPosition, offset, 100, 14); | 376 NSRect frame = NSMakeRect(kTextXPosition, offset, 100, 14); |
| 377 NSButton* certButton = [self certificateButtonWithFrame:frame]; | 377 NSButton* certButton = [self certificateButtonWithFrame:frame]; |
| 378 [subviews addObject:certButton]; | 378 [subviews addObject:certButton]; |
| 379 [GTMUILocalizerAndLayoutTweaker sizeToFitView:certButton]; | 379 [GTMUILocalizerAndLayoutTweaker sizeToFitView:certButton]; |
| 380 | 380 |
| 381 // By default, assume that we don't have certificate information to show. | 381 // By default, assume that we don't have certificate information to show. |
| 382 scoped_refptr<net::X509Certificate> cert; | 382 scoped_refptr<net::X509Certificate> cert; |
| 383 CertStore::GetInstance()->RetrieveCert(certID_, &cert); | 383 CertStore::GetInstance()->RetrieveCert(certID_, &cert); |
| 384 | 384 |
| 385 // Don't bother showing certificates if there isn't one. Gears runs | 385 // Don't bother showing certificates if there isn't one. |
| 386 // with no OS root certificate. | |
| 387 if (!cert.get() || !cert->os_cert_handle()) { | 386 if (!cert.get() || !cert->os_cert_handle()) { |
| 388 // This should only ever happen in unit tests. | 387 // This should only ever happen in unit tests. |
| 389 [certButton setEnabled:NO]; | 388 [certButton setEnabled:NO]; |
| 390 } | 389 } |
| 391 | 390 |
| 392 return NSHeight([certButton frame]); | 391 return NSHeight([certButton frame]); |
| 393 } | 392 } |
| 394 | 393 |
| 395 // Adds the state image at a pre-determined x position and the given y. This | 394 // Adds the state image at a pre-determined x position and the given y. This |
| 396 // does not affect the next Y position because the image is placed next to | 395 // does not affect the next Y position because the image is placed next to |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 LocationBarViewMac* locationBar = [controller locationBarBridge]; | 455 LocationBarViewMac* locationBar = [controller locationBarBridge]; |
| 457 if (locationBar) { | 456 if (locationBar) { |
| 458 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); | 457 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); |
| 459 origin = [parent convertBaseToScreen:bubblePoint]; | 458 origin = [parent convertBaseToScreen:bubblePoint]; |
| 460 } | 459 } |
| 461 } | 460 } |
| 462 return origin; | 461 return origin; |
| 463 } | 462 } |
| 464 | 463 |
| 465 @end | 464 @end |
| OLD | NEW |