summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjcampan@google.com <jcampan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 22:26:34 +0000
committerjcampan@google.com <jcampan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 22:26:34 +0000
commitdbcff866e06170d827624635cca0ae832808263d (patch)
tree7b355ad1b736e860b5cb8d678c7572f0ae85653e /chrome
parent43530b348b5dd6dce73c98be7295eba45b7a49be (diff)
downloadchromium_src-dbcff866e06170d827624635cca0ae832808263d.zip
chromium_src-dbcff866e06170d827624635cca0ae832808263d.tar.gz
chromium_src-dbcff866e06170d827624635cca0ae832808263d.tar.bz2
Don't show the "Cert info" button when running with Gears (or anytime you have a cert with no associated os cert handle) as it requires the os cert handle.
BUG=1302313 TEST=Run GMail with Gears in offline mode. Open the page info. There should be no Cert Info button. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@345 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/page_info_window.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/page_info_window.cc b/chrome/browser/page_info_window.cc
index 7082e28..475dfbe 100644
--- a/chrome/browser/page_info_window.cc
+++ b/chrome/browser/page_info_window.cc
@@ -572,10 +572,17 @@ void PageInfoWindow::Init(Profile* profile,
ChromeViews::Window::CreateChromeWindow(parent, gfx::Rect(), this);
// TODO(beng): (Cleanup) - cert viewer button should use GetExtraView.
+
if (cert_id_) {
- contents_->GetParent()->AddChildView(cert_info_button_);
- contents_->set_cert_viewer_button(cert_info_button_);
- contents_->Layout();
+ scoped_refptr<net::X509Certificate> cert;
+ CertStore::GetSharedInstance()->RetrieveCert(cert_id_, &cert);
+ // When running with Gears, we have no os certificate, so there is no cert
+ // to show. Don't bother showing the cert info button in that case.
+ if (cert.get() && cert->os_cert_handle()) {
+ contents_->GetParent()->AddChildView(cert_info_button_);
+ contents_->set_cert_viewer_button(cert_info_button_);
+ contents_->Layout();
+ }
}
}