1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_SIGNED_CERTIFICATE_TIMESTAMP_INFO_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_SIGNED_CERTIFICATE_TIMESTAMP_INFO_VIEW_H_
10 #include "net/cert/sct_status_flags.h"
11 #include "ui/views/view.h"
20 struct SignedCertificateTimestamp
;
27 // Utility function to translate an SCT status to resource ID.
28 int StatusToResourceID(net::ct::SCTVerifyStatus status
);
29 int SCTOriginToResourceID(const net::ct::SignedCertificateTimestamp
& sct
);
34 // Responsible for displaying a tabular grid of SCT information.
35 // Only displays information about one SCT at a time.
36 class SignedCertificateTimestampInfoView
: public views::View
{
38 SignedCertificateTimestampInfoView();
39 virtual ~SignedCertificateTimestampInfoView();
41 // Updates the display to show information for the given SCT.
42 void SetSignedCertificateTimestamp(
43 const net::ct::SignedCertificateTimestamp
& sct
,
44 net::ct::SCTVerifyStatus status
);
46 // Clears the SCT display to indicate that no SCT is selected.
50 // views::View implementation
51 virtual void ViewHierarchyChanged(const ViewHierarchyChangedDetails
& details
)
54 // Layout helper routines.
55 void AddLabelRow(int layout_id
,
56 views::GridLayout
* layout
,
58 views::Label
* data_label
);
60 // Sets up the view layout.
63 // Individual property labels
64 views::Label
* status_value_field_
;
65 views::Label
* origin_value_field_
;
66 views::Label
* version_value_field_
;
67 views::Label
* log_description_value_field_
;
68 views::Label
* log_id_value_field_
;
69 views::Label
* timestamp_value_field_
;
70 views::Label
* hash_algorithm_value_field_
;
71 views::Label
* signature_algorithm_value_field_
;
72 views::Label
* signature_data_value_field_
;
74 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestampInfoView
);
77 #endif // CHROME_BROWSER_UI_VIEWS_SIGNED_CERTIFICATE_TIMESTAMP_INFO_VIEW_H_