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/gtk/website_settings/website_settings_popup_gtk.h" | 5 #include "chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/certificate_viewer.h" | 10 #include "chrome/browser/certificate_viewer.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 theme_service_(GtkThemeService::GetFrom(profile)), | 212 theme_service_(GtkThemeService::GetFrom(profile)), |
213 profile_(profile), | 213 profile_(profile), |
214 web_contents_(web_contents), | 214 web_contents_(web_contents), |
215 browser_(NULL), | 215 browser_(NULL), |
216 cert_id_(0), | 216 cert_id_(0), |
217 header_box_(NULL), | 217 header_box_(NULL), |
218 cookies_section_contents_(NULL), | 218 cookies_section_contents_(NULL), |
219 permissions_section_contents_(NULL), | 219 permissions_section_contents_(NULL), |
220 identity_contents_(NULL), | 220 identity_contents_(NULL), |
221 connection_contents_(NULL), | 221 connection_contents_(NULL), |
| 222 cert_transparency_contents_(NULL), |
222 first_visit_contents_(NULL), | 223 first_visit_contents_(NULL), |
223 notebook_(NULL) { | 224 notebook_(NULL) { |
224 BrowserWindowGtk* browser_window = | 225 BrowserWindowGtk* browser_window = |
225 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); | 226 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); |
226 browser_ = browser_window->browser(); | 227 browser_ = browser_window->browser(); |
227 anchor_ = browser_window-> | 228 anchor_ = browser_window-> |
228 GetToolbar()->GetLocationBarView()->location_icon_widget(); | 229 GetToolbar()->GetLocationBarView()->location_icon_widget(); |
229 | 230 |
230 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 231 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
231 content::Source<ThemeService>(theme_service_)); | 232 content::Source<ThemeService>(theme_service_)); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 identity_contents_ = gtk_vbox_new(FALSE, 0); | 306 identity_contents_ = gtk_vbox_new(FALSE, 0); |
306 gtk_box_pack_start(GTK_BOX(connection_tab), identity_contents_, FALSE, FALSE, | 307 gtk_box_pack_start(GTK_BOX(connection_tab), identity_contents_, FALSE, FALSE, |
307 0); | 308 0); |
308 gtk_box_pack_start(GTK_BOX(connection_tab), gtk_hseparator_new(), FALSE, | 309 gtk_box_pack_start(GTK_BOX(connection_tab), gtk_hseparator_new(), FALSE, |
309 FALSE, 0); | 310 FALSE, 0); |
310 connection_contents_ = gtk_vbox_new(FALSE, 0); | 311 connection_contents_ = gtk_vbox_new(FALSE, 0); |
311 gtk_box_pack_start(GTK_BOX(connection_tab), connection_contents_, FALSE, | 312 gtk_box_pack_start(GTK_BOX(connection_tab), connection_contents_, FALSE, |
312 FALSE, 0); | 313 FALSE, 0); |
313 gtk_box_pack_start(GTK_BOX(connection_tab), gtk_hseparator_new(), FALSE, | 314 gtk_box_pack_start(GTK_BOX(connection_tab), gtk_hseparator_new(), FALSE, |
314 FALSE, 0); | 315 FALSE, 0); |
| 316 cert_transparency_contents_ = gtk_vbox_new(FALSE, 0); |
| 317 gtk_box_pack_start(GTK_BOX(connection_tab), cert_transparency_contents_, |
| 318 FALSE, FALSE, 0); |
| 319 gtk_box_pack_start(GTK_BOX(connection_tab), gtk_hseparator_new(), FALSE, |
| 320 FALSE, 0); |
315 first_visit_contents_ = gtk_vbox_new(FALSE, 0); | 321 first_visit_contents_ = gtk_vbox_new(FALSE, 0); |
316 gtk_box_pack_start(GTK_BOX(connection_tab), first_visit_contents_, FALSE, | 322 gtk_box_pack_start(GTK_BOX(connection_tab), first_visit_contents_, FALSE, |
317 FALSE, 0); | 323 FALSE, 0); |
318 gtk_box_pack_start(GTK_BOX(connection_tab), gtk_hseparator_new(), FALSE, | 324 gtk_box_pack_start(GTK_BOX(connection_tab), gtk_hseparator_new(), FALSE, |
319 FALSE, 0); | 325 FALSE, 0); |
320 | 326 |
321 GtkWidget* help_link = theme_service_->BuildChromeLinkButton( | 327 GtkWidget* help_link = theme_service_->BuildChromeLinkButton( |
322 l10n_util::GetStringUTF8(IDS_PAGE_INFO_HELP_CENTER_LINK)); | 328 l10n_util::GetStringUTF8(IDS_PAGE_INFO_HELP_CENTER_LINK)); |
323 GtkWidget* help_link_hbox = gtk_hbox_new(FALSE, 0); | 329 GtkWidget* help_link_hbox = gtk_hbox_new(FALSE, 0); |
324 gtk_container_set_border_width(GTK_CONTAINER(help_link_hbox), | 330 gtk_container_set_border_width(GTK_CONTAINER(help_link_hbox), |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 GtkWidget* connection_description = | 546 GtkWidget* connection_description = |
541 CreateTextLabel(identity_info.connection_status_description, | 547 CreateTextLabel(identity_info.connection_status_description, |
542 kConnectionTabTextWidth, theme_service_, ui::kGdkBlack); | 548 kConnectionTabTextWidth, theme_service_, ui::kGdkBlack); |
543 section_content = gtk_vbox_new(FALSE, ui::kControlSpacing); | 549 section_content = gtk_vbox_new(FALSE, ui::kControlSpacing); |
544 gtk_box_pack_start(GTK_BOX(section_content), connection_description, FALSE, | 550 gtk_box_pack_start(GTK_BOX(section_content), connection_description, FALSE, |
545 FALSE, 0); | 551 FALSE, 0); |
546 SetConnectionSection( | 552 SetConnectionSection( |
547 connection_contents_, | 553 connection_contents_, |
548 WebsiteSettingsUI::GetConnectionIcon(identity_info.connection_status), | 554 WebsiteSettingsUI::GetConnectionIcon(identity_info.connection_status), |
549 section_content); | 555 section_content); |
| 556 |
| 557 // Create Certificate Transparency section. |
| 558 GtkWidget* ct_description = |
| 559 CreateTextLabel(identity_info.cert_transparency_description, |
| 560 kConnectionTabTextWidth, theme_service_, ui::kGdkBlack); |
| 561 section_content = gtk_vbox_new(FALSE, ui::kControlSpacing); |
| 562 gtk_box_pack_start(GTK_BOX(section_content), ct_description, FALSE, FALSE, |
| 563 0); |
| 564 SetConnectionSection( |
| 565 cert_transparency_contents_, |
| 566 WebsiteSettingsUI::GetCertTransparencyIcon( |
| 567 identity_info.cert_transparency_status), |
| 568 section_content); |
550 } | 569 } |
551 | 570 |
552 void WebsiteSettingsPopupGtk::SetFirstVisit(const string16& first_visit) { | 571 void WebsiteSettingsPopupGtk::SetFirstVisit(const string16& first_visit) { |
553 GtkWidget* title = theme_service_->BuildLabel( | 572 GtkWidget* title = theme_service_->BuildLabel( |
554 l10n_util::GetStringUTF8(IDS_PAGE_INFO_SITE_INFO_TITLE), | 573 l10n_util::GetStringUTF8(IDS_PAGE_INFO_SITE_INFO_TITLE), |
555 ui::kGdkBlack); | 574 ui::kGdkBlack); |
556 PangoAttrList* attributes = pango_attr_list_new(); | 575 PangoAttrList* attributes = pango_attr_list_new(); |
557 pango_attr_list_insert(attributes, | 576 pango_attr_list_insert(attributes, |
558 pango_attr_weight_new(PANGO_WEIGHT_BOLD)); | 577 pango_attr_weight_new(PANGO_WEIGHT_BOLD)); |
559 gtk_label_set_attributes(GTK_LABEL(title), attributes); | 578 gtk_label_set_attributes(GTK_LABEL(title), attributes); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 } | 747 } |
729 | 748 |
730 void WebsiteSettingsPopupGtk::OnHelpLinkClicked(GtkWidget* widget) { | 749 void WebsiteSettingsPopupGtk::OnHelpLinkClicked(GtkWidget* widget) { |
731 browser_->OpenURL(OpenURLParams(GURL(chrome::kPageInfoHelpCenterURL), | 750 browser_->OpenURL(OpenURLParams(GURL(chrome::kPageInfoHelpCenterURL), |
732 content::Referrer(), | 751 content::Referrer(), |
733 NEW_FOREGROUND_TAB, | 752 NEW_FOREGROUND_TAB, |
734 content::PAGE_TRANSITION_LINK, | 753 content::PAGE_TRANSITION_LINK, |
735 false)); | 754 false)); |
736 bubble_->Close(); | 755 bubble_->Close(); |
737 } | 756 } |
OLD | NEW |