NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / ui / views / signed_certificate_timestamps_views.h
blob247cf8a89cf3e4461e88575c078128f87d1b9a1c
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_TIMESTAMPS_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_SIGNED_CERTIFICATE_TIMESTAMPS_VIEWS_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/public/browser/notification_observer.h"
10 #include "net/cert/signed_certificate_timestamp.h"
11 #include "net/ssl/signed_certificate_timestamp_and_status.h"
12 #include "ui/views/controls/combobox/combobox_listener.h"
13 #include "ui/views/window/dialog_delegate.h"
15 namespace content {
16 class WebContents;
19 namespace views {
20 class Combobox;
21 class Widget;
24 class SignedCertificateTimestampInfoView;
25 class SCTListModel;
27 // The Views implementation of the signed certificate timestamps viewer.
28 class SignedCertificateTimestampsViews : public views::DialogDelegateView,
29 public content::NotificationObserver,
30 public views::ComboboxListener {
31 public:
32 // Use ShowSignedCertificateTimestampsViewer to show.
33 SignedCertificateTimestampsViews(
34 content::WebContents* web_contents,
35 const net::SignedCertificateTimestampAndStatusList& sct_list);
36 virtual ~SignedCertificateTimestampsViews();
38 // views::DialogDelegate:
39 virtual base::string16 GetWindowTitle() const OVERRIDE;
40 virtual int GetDialogButtons() const OVERRIDE;
41 virtual ui::ModalType GetModalType() const OVERRIDE;
43 // views::View:
44 virtual gfx::Size GetMinimumSize() OVERRIDE;
45 virtual void ViewHierarchyChanged(const ViewHierarchyChangedDetails& details)
46 OVERRIDE;
48 private:
49 void Init();
51 void ShowSCTInfo(int sct_index);
53 // views::ComboboxListener:
54 virtual void OnPerformAction(views::Combobox* combobox) OVERRIDE;
56 // content::NotificationObserver:
57 virtual void Observe(int type,
58 const content::NotificationSource& source,
59 const content::NotificationDetails& details) OVERRIDE;
61 content::WebContents* web_contents_;
63 SignedCertificateTimestampInfoView* sct_info_view_;
65 scoped_ptr<SCTListModel> sct_list_model_;
66 // The Combobox used to select the SCT to display. This class owns the pointer
67 // as it has to be deleted explicitly before the views c'tor is called:
68 // The Combobox d'tor refers to the model it holds, which will be destructed
69 // as part of tearing down this class. So it will not be available when the
70 // Views d'tor destroys the Combobox, leading to a crash.
71 // Must be deleted before the model.
72 scoped_ptr<views::Combobox> sct_selector_box_;
73 net::SignedCertificateTimestampAndStatusList sct_list_;
75 DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestampsViews);
78 #endif // CHROME_BROWSER_UI_VIEWS_SIGNED_CERTIFICATE_TIMESTAMPS_VIEWS_H_