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

Side by Side Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 27026002: CT: Adding preliminary Certificate Transparency support to Chromium. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Distinguish between SCTs from unknown logs and unverified ones Created 7 years, 1 month 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
OLDNEW
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/website_settings/website_settings_popup_view.h " 5 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h "
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/certificate_viewer.h" 9 #include "chrome/browser/certificate_viewer.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 site_data_content_(NULL), 285 site_data_content_(NULL),
286 cookie_dialog_link_(NULL), 286 cookie_dialog_link_(NULL),
287 permissions_content_(NULL), 287 permissions_content_(NULL),
288 connection_tab_(NULL), 288 connection_tab_(NULL),
289 identity_info_content_(NULL), 289 identity_info_content_(NULL),
290 certificate_dialog_link_(NULL), 290 certificate_dialog_link_(NULL),
291 cert_id_(0), 291 cert_id_(0),
292 help_center_link_(NULL), 292 help_center_link_(NULL),
293 connection_info_content_(NULL), 293 connection_info_content_(NULL),
294 page_info_content_(NULL), 294 page_info_content_(NULL),
295 cert_trans_info_content_(NULL),
295 weak_factory_(this) { 296 weak_factory_(this) {
296 // Compensate for built-in vertical padding in the anchor view's image. 297 // Compensate for built-in vertical padding in the anchor view's image.
297 set_anchor_view_insets(gfx::Insets(kLocationIconVerticalMargin, 0, 298 set_anchor_view_insets(gfx::Insets(kLocationIconVerticalMargin, 0,
298 kLocationIconVerticalMargin, 0)); 299 kLocationIconVerticalMargin, 0));
299 300
300 views::GridLayout* layout = new views::GridLayout(this); 301 views::GridLayout* layout = new views::GridLayout(this);
301 SetLayoutManager(layout); 302 SetLayoutManager(layout);
302 const int content_column = 0; 303 const int content_column = 0;
303 views::ColumnSet* column_set = layout->AddColumnSet(content_column); 304 views::ColumnSet* column_set = layout->AddColumnSet(content_column);
304 column_set->AddColumn(views::GridLayout::FILL, 305 column_set->AddColumn(views::GridLayout::FILL,
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 UTF8ToUTF16(identity_info.identity_status_description), 534 UTF8ToUTF16(identity_info.identity_status_description),
534 certificate_dialog_link_); 535 certificate_dialog_link_);
535 536
536 ResetConnectionSection( 537 ResetConnectionSection(
537 connection_info_content_, 538 connection_info_content_,
538 WebsiteSettingsUI::GetConnectionIcon(identity_info.connection_status), 539 WebsiteSettingsUI::GetConnectionIcon(identity_info.connection_status),
539 string16(), // The connection section has no headline. 540 string16(), // The connection section has no headline.
540 UTF8ToUTF16(identity_info.connection_status_description), 541 UTF8ToUTF16(identity_info.connection_status_description),
541 NULL); 542 NULL);
542 543
544 ResetConnectionSection(
545 cert_trans_info_content_,
546 WebsiteSettingsUI::GetCertTransparencyIcon(
547 identity_info.cert_transparency_status),
548 string16(), // The Certificate Transparency section has no headline.
549 UTF8ToUTF16(identity_info.cert_transparency_description),
550 NULL);
551
543 connection_tab_->InvalidateLayout(); 552 connection_tab_->InvalidateLayout();
544 Layout(); 553 Layout();
545 SizeToContents(); 554 SizeToContents();
546 } 555 }
547 556
548 void WebsiteSettingsPopupView::SetFirstVisit(const string16& first_visit) { 557 void WebsiteSettingsPopupView::SetFirstVisit(const string16& first_visit) {
549 ResetConnectionSection( 558 ResetConnectionSection(
550 page_info_content_, 559 page_info_content_,
551 WebsiteSettingsUI::GetFirstVisitIcon(first_visit), 560 WebsiteSettingsUI::GetFirstVisitIcon(first_visit),
552 l10n_util::GetStringUTF16(IDS_PAGE_INFO_SITE_INFO_TITLE), 561 l10n_util::GetStringUTF16(IDS_PAGE_INFO_SITE_INFO_TITLE),
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1)); 602 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1));
594 // Add site identity section. 603 // Add site identity section.
595 identity_info_content_ = new views::View(); 604 identity_info_content_ = new views::View();
596 pane->AddChildView(identity_info_content_); 605 pane->AddChildView(identity_info_content_);
597 606
598 // Add connection section. 607 // Add connection section.
599 pane->AddChildView(new views::Separator(views::Separator::HORIZONTAL)); 608 pane->AddChildView(new views::Separator(views::Separator::HORIZONTAL));
600 connection_info_content_ = new views::View(); 609 connection_info_content_ = new views::View();
601 pane->AddChildView(connection_info_content_); 610 pane->AddChildView(connection_info_content_);
602 611
612 // Add Certificate Transparency section.
613 pane->AddChildView(new views::Separator(views::Separator::HORIZONTAL));
614 cert_trans_info_content_ = new views::View();
615 pane->AddChildView(cert_trans_info_content_);
616
603 // Add page info section. 617 // Add page info section.
604 pane->AddChildView(new views::Separator(views::Separator::HORIZONTAL)); 618 pane->AddChildView(new views::Separator(views::Separator::HORIZONTAL));
605 page_info_content_ = new views::View(); 619 page_info_content_ = new views::View();
606 pane->AddChildView(page_info_content_); 620 pane->AddChildView(page_info_content_);
607 621
608 // Add help center link. 622 // Add help center link.
609 pane->AddChildView(new views::Separator(views::Separator::HORIZONTAL)); 623 pane->AddChildView(new views::Separator(views::Separator::HORIZONTAL));
610 help_center_link_ = new views::Link( 624 help_center_link_ = new views::Link(
611 l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELP_CENTER_LINK)); 625 l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELP_CENTER_LINK));
612 help_center_link_->set_listener(this); 626 help_center_link_->set_listener(this);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 ShowCertificateViewerByID(web_contents_, parent, cert_id_); 770 ShowCertificateViewerByID(web_contents_, parent, cert_id_);
757 } else if (source == help_center_link_) { 771 } else if (source == help_center_link_) {
758 browser_->OpenURL(content::OpenURLParams( 772 browser_->OpenURL(content::OpenURLParams(
759 GURL(chrome::kPageInfoHelpCenterURL), 773 GURL(chrome::kPageInfoHelpCenterURL),
760 content::Referrer(), 774 content::Referrer(),
761 NEW_FOREGROUND_TAB, 775 NEW_FOREGROUND_TAB,
762 content::PAGE_TRANSITION_LINK, 776 content::PAGE_TRANSITION_LINK,
763 false)); 777 false));
764 } 778 }
765 } 779 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698