OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/signed_certificate_timestamps_views.h" | 5 #include "chrome/browser/ui/views/signed_certificate_timestamps_views.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 content::WebContents* web_contents, | 104 content::WebContents* web_contents, |
105 const net::SignedCertificateTimestampAndStatusList& sct_list) | 105 const net::SignedCertificateTimestampAndStatusList& sct_list) |
106 : web_contents_(web_contents), sct_info_view_(NULL), sct_list_(sct_list) { | 106 : web_contents_(web_contents), sct_info_view_(NULL), sct_list_(sct_list) { |
107 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 107 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
108 WebContentsModalDialogManager::FromWebContents(web_contents); | 108 WebContentsModalDialogManager::FromWebContents(web_contents); |
109 WebContentsModalDialogManagerDelegate* modal_delegate = | 109 WebContentsModalDialogManagerDelegate* modal_delegate = |
110 web_contents_modal_dialog_manager->delegate(); | 110 web_contents_modal_dialog_manager->delegate(); |
111 DCHECK(modal_delegate); | 111 DCHECK(modal_delegate); |
112 views::Widget* window = views::Widget::CreateWindowAsFramelessChild( | 112 views::Widget* window = views::Widget::CreateWindowAsFramelessChild( |
113 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | 113 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
114 web_contents_modal_dialog_manager->ShowDialog(window->GetNativeView()); | 114 web_contents_modal_dialog_manager->ShowModalDialog( |
| 115 window->GetNativeView()); |
115 } | 116 } |
116 | 117 |
117 SignedCertificateTimestampsViews::~SignedCertificateTimestampsViews() {} | 118 SignedCertificateTimestampsViews::~SignedCertificateTimestampsViews() {} |
118 | 119 |
119 base::string16 SignedCertificateTimestampsViews::GetWindowTitle() const { | 120 base::string16 SignedCertificateTimestampsViews::GetWindowTitle() const { |
120 return l10n_util::GetStringUTF16(IDS_SCT_VIEWER_TITLE); | 121 return l10n_util::GetStringUTF16(IDS_SCT_VIEWER_TITLE); |
121 } | 122 } |
122 | 123 |
123 int SignedCertificateTimestampsViews::GetDialogButtons() const { | 124 int SignedCertificateTimestampsViews::GetDialogButtons() const { |
124 return ui::DIALOG_BUTTON_CANCEL; | 125 return ui::DIALOG_BUTTON_CANCEL; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 sct_info_view_->SetSignedCertificateTimestamp(*(sct_list_[sct_index].sct), | 183 sct_info_view_->SetSignedCertificateTimestamp(*(sct_list_[sct_index].sct), |
183 sct_list_[sct_index].status); | 184 sct_list_[sct_index].status); |
184 } | 185 } |
185 | 186 |
186 void SignedCertificateTimestampsViews::Observe( | 187 void SignedCertificateTimestampsViews::Observe( |
187 int type, | 188 int type, |
188 const content::NotificationSource& source, | 189 const content::NotificationSource& source, |
189 const content::NotificationDetails& details) { | 190 const content::NotificationDetails& details) { |
190 GetWidget()->Close(); | 191 GetWidget()->Close(); |
191 } | 192 } |
OLD | NEW |