Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/browser/cocoa/page_info_window_mac.mm

Issue 159521: Implementation of the page info dialog on Linux Gtk. (Closed)
Patch Set: Fix build Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/gtk/browser_window_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/page_info_window_mac.h" 5 #include "chrome/browser/cocoa/page_info_window_mac.h"
6 6
7 #include <Security/Security.h> 7 #include <Security/Security.h>
8 #include <SecurityInterface/SFCertificatePanel.h> 8 #include <SecurityInterface/SFCertificatePanel.h>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 std::wstring identity_msg; 87 std::wstring identity_msg;
88 std::wstring connection_msg; 88 std::wstring connection_msg;
89 89
90 // Identity section 90 // Identity section
91 PageInfoModel::SectionInfo identity_section = 91 PageInfoModel::SectionInfo identity_section =
92 model_.GetSectionInfo(PageInfoModel::IDENTITY); 92 model_.GetSectionInfo(PageInfoModel::IDENTITY);
93 if (identity_section.state) 93 if (identity_section.state)
94 [controller_ setIdentityImg:[controller_ goodImg]]; 94 [controller_ setIdentityImg:[controller_ goodImg]];
95 else 95 else
96 [controller_ setIdentityImg:[controller_ badImg]]; 96 [controller_ setIdentityImg:[controller_ badImg]];
97 [controller_ setIdentityMsg:base::SysWideToNSString( 97 [controller_ setIdentityMsg:base::SysUTF16ToNSString(
98 identity_section.description)]; 98 identity_section.description)];
99 99
100 // Connection section. 100 // Connection section.
101 PageInfoModel::SectionInfo connection_section = 101 PageInfoModel::SectionInfo connection_section =
102 model_.GetSectionInfo(PageInfoModel::CONNECTION); 102 model_.GetSectionInfo(PageInfoModel::CONNECTION);
103 if (connection_section.state) 103 if (connection_section.state)
104 [controller_ setConnectionImg:[controller_ goodImg]]; 104 [controller_ setConnectionImg:[controller_ goodImg]];
105 else 105 else
106 [controller_ setConnectionImg:[controller_ badImg]]; 106 [controller_ setConnectionImg:[controller_ badImg]];
107 [controller_ setConnectionMsg: 107 [controller_ setConnectionMsg:
108 base::SysWideToNSString(connection_section.description)]; 108 base::SysUTF16ToNSString(connection_section.description)];
109 109
110 if (model_.GetSectionCount() > 2) { 110 if (model_.GetSectionCount() > 2) {
111 // We have the history info. 111 // We have the history info.
112 PageInfoModel::SectionInfo history_section = 112 PageInfoModel::SectionInfo history_section =
113 model_.GetSectionInfo(PageInfoModel::HISTORY); 113 model_.GetSectionInfo(PageInfoModel::HISTORY);
114 if (history_section.state) 114 if (history_section.state)
115 [controller_ setHistoryImg:[controller_ goodImg]]; 115 [controller_ setHistoryImg:[controller_ goodImg]];
116 else 116 else
117 [controller_ setHistoryImg:[controller_ badImg]]; 117 [controller_ setHistoryImg:[controller_ badImg]];
118 118
119 [controller_ setHistoryMsg: 119 [controller_ setHistoryMsg:
120 base::SysWideToNSString(history_section.description)]; 120 base::SysUTF16ToNSString(history_section.description)];
121 } 121 }
122 122
123 // By default, assume that we don't have certificate information to show. 123 // By default, assume that we don't have certificate information to show.
124 [controller_ setEnableCertButton:NO]; 124 [controller_ setEnableCertButton:NO];
125 if (cert_id_) { 125 if (cert_id_) {
126 scoped_refptr<net::X509Certificate> cert; 126 scoped_refptr<net::X509Certificate> cert;
127 CertStore::GetSharedInstance()->RetrieveCert(cert_id_, &cert); 127 CertStore::GetSharedInstance()->RetrieveCert(cert_id_, &cert);
128 128
129 // Don't bother showing certificates if there isn't one. Gears runs with no 129 // Don't bother showing certificates if there isn't one. Gears runs with no
130 // os root certificate. 130 // os root certificate.
131 if (cert.get() && cert->os_cert_handle()) { 131 if (cert.get() && cert->os_cert_handle()) {
132 [controller_ setEnableCertButton:YES]; 132 [controller_ setEnableCertButton:YES];
133 } 133 }
134 } 134 }
135 } 135 }
136 136
137 void PageInfoWindowMac::ModelChanged() { 137 void PageInfoWindowMac::ModelChanged() {
138 // We have history information, so show the box and extend the window frame. 138 // We have history information, so show the box and extend the window frame.
139 [controller_ setShowHistoryBox:YES]; 139 [controller_ setShowHistoryBox:YES];
140 LayoutSections(); 140 LayoutSections();
141 } 141 }
142 142
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gtk/browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698