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 #include "chrome/browser/ui/views/page_info_bubble_view.h" | 5 #include "chrome/browser/ui/views/page_info_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/certificate_viewer.h" | 10 #include "chrome/browser/certificate_viewer.h" |
11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
12 #include "chrome/browser/ui/views/frame/browser_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_view.h" |
13 #include "chrome/browser/ui/views/toolbar_view.h" | 13 #include "chrome/browser/ui/views/toolbar_view.h" |
14 #include "chrome/browser/ui/views/window.h" | 14 #include "chrome/browser/ui/views/window.h" |
15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
16 #include "content/browser/cert_store.h" | 16 #include "content/public/browser/cert_store.h" |
17 #include "content/public/common/ssl_status.h" | 17 #include "content/public/common/ssl_status.h" |
18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
19 #include "grit/locale_settings.h" | 19 #include "grit/locale_settings.h" |
| 20 #include "net/base/x509_certificate.h" |
20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
22 #include "ui/gfx/canvas_skia.h" | 23 #include "ui/gfx/canvas_skia.h" |
23 #include "ui/gfx/image/image.h" | 24 #include "ui/gfx/image/image.h" |
24 #include "ui/views/controls/image_view.h" | 25 #include "ui/views/controls/image_view.h" |
25 #include "ui/views/controls/label.h" | 26 #include "ui/views/controls/label.h" |
26 #include "ui/views/controls/link.h" | 27 #include "ui/views/controls/link.h" |
27 #include "ui/views/controls/separator.h" | 28 #include "ui/views/controls/separator.h" |
28 #include "ui/views/layout/grid_layout.h" | 29 #include "ui/views/layout/grid_layout.h" |
29 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT), | 111 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT), |
111 ALLOW_THIS_IN_INITIALIZER_LIST(model_(profile, url, ssl, | 112 ALLOW_THIS_IN_INITIALIZER_LIST(model_(profile, url, ssl, |
112 show_history, this)), | 113 show_history, this)), |
113 cert_id_(ssl.cert_id), | 114 cert_id_(ssl.cert_id), |
114 help_center_link_(NULL), | 115 help_center_link_(NULL), |
115 ALLOW_THIS_IN_INITIALIZER_LIST(resize_animation_(this)), | 116 ALLOW_THIS_IN_INITIALIZER_LIST(resize_animation_(this)), |
116 animation_start_height_(0) { | 117 animation_start_height_(0) { |
117 | 118 |
118 if (cert_id_ > 0) { | 119 if (cert_id_ > 0) { |
119 scoped_refptr<net::X509Certificate> cert; | 120 scoped_refptr<net::X509Certificate> cert; |
120 CertStore::GetInstance()->RetrieveCert(cert_id_, &cert); | 121 content::CertStore::GetInstance()->RetrieveCert(cert_id_, &cert); |
121 // When running with fake certificate (Chrome Frame), we have no os | 122 // When running with fake certificate (Chrome Frame), we have no os |
122 // certificate, so there is no cert to show. Don't bother showing the cert | 123 // certificate, so there is no cert to show. Don't bother showing the cert |
123 // info link in that case. | 124 // info link in that case. |
124 if (!cert.get() || !cert->os_cert_handle()) | 125 if (!cert.get() || !cert->os_cert_handle()) |
125 cert_id_ = 0; | 126 cert_id_ = 0; |
126 } | 127 } |
127 LayoutSections(); | 128 LayoutSections(); |
128 } | 129 } |
129 | 130 |
130 PageInfoBubbleView::~PageInfoBubbleView() { | 131 PageInfoBubbleView::~PageInfoBubbleView() { |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 const GURL& url, | 479 const GURL& url, |
479 const SSLStatus& ssl, | 480 const SSLStatus& ssl, |
480 bool show_history) { | 481 bool show_history) { |
481 PageInfoBubbleView* page_info_bubble = | 482 PageInfoBubbleView* page_info_bubble = |
482 new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history); | 483 new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history); |
483 browser::CreateViewsBubble(page_info_bubble); | 484 browser::CreateViewsBubble(page_info_bubble); |
484 page_info_bubble->Show(); | 485 page_info_bubble->Show(); |
485 } | 486 } |
486 | 487 |
487 } | 488 } |
OLD | NEW |