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

Side by Side Diff: chrome/browser/ui/gtk/ssl_client_certificate_selector.cc

Issue 7737001: content: Start splitting up chrome/browser/ui/gtk/gtk_util.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/gtk/sad_tab_gtk.cc ('k') | chrome/browser/ui/gtk/status_bubble_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) 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 #include "chrome/browser/ssl_client_certificate_selector.h" 5 #include "chrome/browser/ssl_client_certificate_selector.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/i18n/time_formatting.h" 12 #include "base/i18n/time_formatting.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/certificate_viewer.h" 15 #include "chrome/browser/certificate_viewer.h"
16 #include "chrome/browser/ui/crypto_module_password_dialog.h" 16 #include "chrome/browser/ui/crypto_module_password_dialog.h"
17 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" 17 #include "chrome/browser/ui/gtk/constrained_window_gtk.h"
18 #include "chrome/browser/ui/gtk/gtk_util.h" 18 #include "chrome/browser/ui/gtk/gtk_util.h"
19 #include "chrome/common/net/x509_certificate_model.h" 19 #include "chrome/common/net/x509_certificate_model.h"
20 #include "content/browser/browser_thread.h" 20 #include "content/browser/browser_thread.h"
21 #include "content/browser/ssl/ssl_client_auth_handler.h" 21 #include "content/browser/ssl/ssl_client_auth_handler.h"
22 #include "content/browser/tab_contents/tab_contents.h" 22 #include "content/browser/tab_contents/tab_contents.h"
23 #include "grit/generated_resources.h" 23 #include "grit/generated_resources.h"
24 #include "net/base/x509_certificate.h" 24 #include "net/base/x509_certificate.h"
25 #include "ui/base/gtk/gtk_hig_constants.h"
25 #include "ui/base/gtk/gtk_signal.h" 26 #include "ui/base/gtk/gtk_signal.h"
26 #include "ui/base/gtk/owned_widget_gtk.h" 27 #include "ui/base/gtk/owned_widget_gtk.h"
27 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
28 #include "ui/gfx/native_widget_types.h" 29 #include "ui/gfx/native_widget_types.h"
29 30
30 namespace { 31 namespace {
31 32
32 enum { 33 enum {
33 RESPONSE_SHOW_CERT_INFO = 1, 34 RESPONSE_SHOW_CERT_INFO = 1,
34 }; 35 };
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 98
98 SSLClientCertificateSelector::SSLClientCertificateSelector( 99 SSLClientCertificateSelector::SSLClientCertificateSelector(
99 TabContents* parent, 100 TabContents* parent,
100 net::SSLCertRequestInfo* cert_request_info, 101 net::SSLCertRequestInfo* cert_request_info,
101 SSLClientAuthHandler* delegate) 102 SSLClientAuthHandler* delegate)
102 : SSLClientAuthObserver(cert_request_info, delegate), 103 : SSLClientAuthObserver(cert_request_info, delegate),
103 cert_request_info_(cert_request_info), 104 cert_request_info_(cert_request_info),
104 delegate_(delegate), 105 delegate_(delegate),
105 parent_(parent), 106 parent_(parent),
106 window_(NULL) { 107 window_(NULL) {
107 root_widget_.Own(gtk_vbox_new(FALSE, gtk_util::kControlSpacing)); 108 root_widget_.Own(gtk_vbox_new(FALSE, ui::kControlSpacing));
108 109
109 GtkWidget* site_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); 110 GtkWidget* site_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing);
110 gtk_box_pack_start(GTK_BOX(root_widget_.get()), site_vbox, 111 gtk_box_pack_start(GTK_BOX(root_widget_.get()), site_vbox,
111 FALSE, FALSE, 0); 112 FALSE, FALSE, 0);
112 113
113 GtkWidget* site_description_label = gtk_util::CreateBoldLabel( 114 GtkWidget* site_description_label = gtk_util::CreateBoldLabel(
114 l10n_util::GetStringUTF8(IDS_CERT_SELECTOR_SITE_DESCRIPTION_LABEL)); 115 l10n_util::GetStringUTF8(IDS_CERT_SELECTOR_SITE_DESCRIPTION_LABEL));
115 gtk_box_pack_start(GTK_BOX(site_vbox), site_description_label, 116 gtk_box_pack_start(GTK_BOX(site_vbox), site_description_label,
116 FALSE, FALSE, 0); 117 FALSE, FALSE, 0);
117 118
118 GtkWidget* site_label = gtk_label_new( 119 GtkWidget* site_label = gtk_label_new(
119 cert_request_info->host_and_port.c_str()); 120 cert_request_info->host_and_port.c_str());
120 gtk_util::LeftAlignMisc(site_label); 121 gtk_util::LeftAlignMisc(site_label);
121 gtk_box_pack_start(GTK_BOX(site_vbox), site_label, FALSE, FALSE, 0); 122 gtk_box_pack_start(GTK_BOX(site_vbox), site_label, FALSE, FALSE, 0);
122 123
123 GtkWidget* selector_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); 124 GtkWidget* selector_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing);
124 gtk_box_pack_start(GTK_BOX(root_widget_.get()), selector_vbox, 125 gtk_box_pack_start(GTK_BOX(root_widget_.get()), selector_vbox,
125 TRUE, TRUE, 0); 126 TRUE, TRUE, 0);
126 127
127 GtkWidget* choose_description_label = gtk_util::CreateBoldLabel( 128 GtkWidget* choose_description_label = gtk_util::CreateBoldLabel(
128 l10n_util::GetStringUTF8(IDS_CERT_SELECTOR_CHOOSE_DESCRIPTION_LABEL)); 129 l10n_util::GetStringUTF8(IDS_CERT_SELECTOR_CHOOSE_DESCRIPTION_LABEL));
129 gtk_box_pack_start(GTK_BOX(selector_vbox), choose_description_label, 130 gtk_box_pack_start(GTK_BOX(selector_vbox), choose_description_label,
130 FALSE, FALSE, 0); 131 FALSE, FALSE, 0);
131 132
132 133
133 cert_combo_box_ = gtk_combo_box_new_text(); 134 cert_combo_box_ = gtk_combo_box_new_text();
(...skipping 18 matching lines...) Expand all
152 // dialog. This does however mean the dialog will grow itself if you switch 153 // dialog. This does however mean the dialog will grow itself if you switch
153 // to different cert that has longer details text. 154 // to different cert that has longer details text.
154 GtkWidget* details_frame = gtk_frame_new(NULL); 155 GtkWidget* details_frame = gtk_frame_new(NULL);
155 gtk_frame_set_shadow_type(GTK_FRAME(details_frame), GTK_SHADOW_ETCHED_IN); 156 gtk_frame_set_shadow_type(GTK_FRAME(details_frame), GTK_SHADOW_ETCHED_IN);
156 gtk_container_add(GTK_CONTAINER(details_frame), cert_details_view); 157 gtk_container_add(GTK_CONTAINER(details_frame), cert_details_view);
157 gtk_box_pack_start(GTK_BOX(selector_vbox), details_frame, TRUE, TRUE, 0); 158 gtk_box_pack_start(GTK_BOX(selector_vbox), details_frame, TRUE, TRUE, 0);
158 159
159 // And then create a set of buttons like a GtkDialog would. 160 // And then create a set of buttons like a GtkDialog would.
160 GtkWidget* button_box = gtk_hbutton_box_new(); 161 GtkWidget* button_box = gtk_hbutton_box_new();
161 gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END); 162 gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END);
162 gtk_box_set_spacing(GTK_BOX(button_box), gtk_util::kControlSpacing); 163 gtk_box_set_spacing(GTK_BOX(button_box), ui::kControlSpacing);
163 gtk_box_pack_end(GTK_BOX(root_widget_.get()), button_box, FALSE, FALSE, 0); 164 gtk_box_pack_end(GTK_BOX(root_widget_.get()), button_box, FALSE, FALSE, 0);
164 165
165 GtkWidget* view_button = gtk_button_new_with_mnemonic( 166 GtkWidget* view_button = gtk_button_new_with_mnemonic(
166 l10n_util::GetStringUTF8(IDS_PAGEINFO_CERT_INFO_BUTTON).c_str()); 167 l10n_util::GetStringUTF8(IDS_PAGEINFO_CERT_INFO_BUTTON).c_str());
167 gtk_box_pack_start(GTK_BOX(button_box), view_button, FALSE, FALSE, 0); 168 gtk_box_pack_start(GTK_BOX(button_box), view_button, FALSE, FALSE, 0);
168 g_signal_connect(view_button, "clicked", 169 g_signal_connect(view_button, "clicked",
169 G_CALLBACK(OnViewClickedThunk), this); 170 G_CALLBACK(OnViewClickedThunk), this);
170 171
171 GtkWidget* cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); 172 GtkWidget* cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
172 gtk_box_pack_end(GTK_BOX(button_box), cancel_button, FALSE, FALSE, 0); 173 gtk_box_pack_end(GTK_BOX(button_box), cancel_button, FALSE, FALSE, 0);
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 TabContents* parent, 395 TabContents* parent,
395 net::SSLCertRequestInfo* cert_request_info, 396 net::SSLCertRequestInfo* cert_request_info,
396 SSLClientAuthHandler* delegate) { 397 SSLClientAuthHandler* delegate) {
397 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
398 (new SSLClientCertificateSelector(parent, 399 (new SSLClientCertificateSelector(parent,
399 cert_request_info, 400 cert_request_info,
400 delegate))->Show(); 401 delegate))->Show();
401 } 402 }
402 403
403 } // namespace browser 404 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/sad_tab_gtk.cc ('k') | chrome/browser/ui/gtk/status_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698