OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/l10n_util_mac.h" | 8 #include "app/l10n_util_mac.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 // Create the certificate button. The frame will be fixed up by GTM, so | 370 // Create the certificate button. The frame will be fixed up by GTM, so |
371 // use arbitrary values. | 371 // use arbitrary values. |
372 NSRect frame = NSMakeRect(kTextXPosition, offset, 100, 14); | 372 NSRect frame = NSMakeRect(kTextXPosition, offset, 100, 14); |
373 NSButton* certButton = [self certificateButtonWithFrame:frame]; | 373 NSButton* certButton = [self certificateButtonWithFrame:frame]; |
374 [subviews addObject:certButton]; | 374 [subviews addObject:certButton]; |
375 [GTMUILocalizerAndLayoutTweaker sizeToFitView:certButton]; | 375 [GTMUILocalizerAndLayoutTweaker sizeToFitView:certButton]; |
376 | 376 |
377 // By default, assume that we don't have certificate information to show. | 377 // By default, assume that we don't have certificate information to show. |
378 scoped_refptr<net::X509Certificate> cert; | 378 scoped_refptr<net::X509Certificate> cert; |
379 CertStore::GetSharedInstance()->RetrieveCert(certID_, &cert); | 379 CertStore::GetInstance()->RetrieveCert(certID_, &cert); |
380 | 380 |
381 // Don't bother showing certificates if there isn't one. Gears runs | 381 // Don't bother showing certificates if there isn't one. Gears runs |
382 // with no OS root certificate. | 382 // with no OS root certificate. |
383 if (!cert.get() || !cert->os_cert_handle()) { | 383 if (!cert.get() || !cert->os_cert_handle()) { |
384 // This should only ever happen in unit tests. | 384 // This should only ever happen in unit tests. |
385 [certButton setEnabled:NO]; | 385 [certButton setEnabled:NO]; |
386 } | 386 } |
387 | 387 |
388 return NSHeight([certButton frame]); | 388 return NSHeight([certButton frame]); |
389 } | 389 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 LocationBarViewMac* locationBar = [controller locationBarBridge]; | 452 LocationBarViewMac* locationBar = [controller locationBarBridge]; |
453 if (locationBar) { | 453 if (locationBar) { |
454 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); | 454 NSPoint bubblePoint = locationBar->GetPageInfoBubblePoint(); |
455 origin = [parent convertBaseToScreen:bubblePoint]; | 455 origin = [parent convertBaseToScreen:bubblePoint]; |
456 } | 456 } |
457 } | 457 } |
458 return origin; | 458 return origin; |
459 } | 459 } |
460 | 460 |
461 @end | 461 @end |
OLD | NEW |