NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / ui / views / signed_certificate_timestamp_info_view.h
blob33fdfb7b56736ca23fd4e5c84cd2f4424c1b6df6
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_
8 #include <vector>
10 #include "net/cert/sct_status_flags.h"
11 #include "ui/views/view.h"
13 namespace views {
14 class GridLayout;
15 class Label;
16 class Textfield;
19 namespace net {
20 namespace ct {
21 struct SignedCertificateTimestamp;
25 namespace chrome {
26 namespace ct {
28 // Utility function to translate an SCT status to resource ID.
29 int StatusToResourceID(net::ct::SCTVerifyStatus status);
30 int SCTOriginToResourceID(const net::ct::SignedCertificateTimestamp& sct);
32 } // namespace ct
33 } // namespace chrome
35 // Responsible for displaying a tabular grid of SCT information.
36 // Only displays information about one SCT at a time.
37 class SignedCertificateTimestampInfoView : public views::View {
38 public:
39 SignedCertificateTimestampInfoView();
40 virtual ~SignedCertificateTimestampInfoView();
42 // Updates the display to show information for the given SCT.
43 void SetSignedCertificateTimestamp(
44 const net::ct::SignedCertificateTimestamp& sct,
45 net::ct::SCTVerifyStatus status);
47 // Clears the SCT display to indicate that no SCT is selected.
48 void ClearDisplay();
50 private:
51 // views::View implementation
52 virtual void ViewHierarchyChanged(const ViewHierarchyChangedDetails& details)
53 OVERRIDE;
55 // Layout helper routines.
56 void AddLabelRow(int layout_id,
57 views::GridLayout* layout,
58 int label_message_id,
59 views::Textfield* text_field);
61 // Sets up the view layout.
62 void Init();
64 // Individual property labels
65 views::Textfield* status_value_field_;
66 views::Textfield* origin_value_field_;
67 views::Textfield* version_value_field_;
68 views::Textfield* log_description_value_field_;
69 views::Textfield* log_id_value_field_;
70 views::Textfield* timestamp_value_field_;
71 views::Textfield* hash_algorithm_value_field_;
72 views::Textfield* signature_algorithm_value_field_;
73 views::Textfield* signature_data_value_field_;
75 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestampInfoView);
78 #endif // CHROME_BROWSER_UI_VIEWS_SIGNED_CERTIFICATE_TIMESTAMP_INFO_VIEW_H_