[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / signed_certificate_timestamp_info_view.h
blob25860e2dfdc2a39f8b6d6a78df0d54c0ba0c260a
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;
18 namespace net {
19 namespace ct {
20 struct SignedCertificateTimestamp;
24 namespace chrome {
25 namespace ct {
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);
31 } // namespace ct
32 } // namespace chrome
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 {
37 public:
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.
47 void ClearDisplay();
49 private:
50 // views::View implementation
51 virtual void ViewHierarchyChanged(const ViewHierarchyChangedDetails& details)
52 OVERRIDE;
54 // Layout helper routines.
55 void AddLabelRow(int layout_id,
56 views::GridLayout* layout,
57 int label_message_id,
58 views::Label* data_label);
60 // Sets up the view layout.
61 void Init();
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_