| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 base::IntToString16(index + 1), | 98 base::IntToString16(index + 1), |
| 99 base::UTF8ToUTF16(origin), | 99 base::UTF8ToUTF16(origin), |
| 100 base::UTF8ToUTF16(status)); | 100 base::UTF8ToUTF16(status)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 SignedCertificateTimestampsViews::SignedCertificateTimestampsViews( | 103 SignedCertificateTimestampsViews::SignedCertificateTimestampsViews( |
| 104 content::WebContents* web_contents, | 104 content::WebContents* web_contents, |
| 105 const net::SignedCertificateTimestampAndStatusList& sct_list) | 105 const net::SignedCertificateTimestampAndStatusList& sct_list) |
| 106 : sct_info_view_(NULL), | 106 : sct_info_view_(NULL), |
| 107 sct_list_(sct_list) { | 107 sct_list_(sct_list) { |
| 108 // TODO(gbillock): Use PopupManager here. |
| 108 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 109 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 109 WebContentsModalDialogManager::FromWebContents(web_contents); | 110 WebContentsModalDialogManager::FromWebContents(web_contents); |
| 110 WebContentsModalDialogManagerDelegate* modal_delegate = | 111 WebContentsModalDialogManagerDelegate* modal_delegate = |
| 111 web_contents_modal_dialog_manager->delegate(); | 112 web_contents_modal_dialog_manager->delegate(); |
| 112 DCHECK(modal_delegate); | 113 DCHECK(modal_delegate); |
| 113 views::Widget* window = views::Widget::CreateWindowAsFramelessChild( | 114 views::Widget* window = views::Widget::CreateWindowAsFramelessChild( |
| 114 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | 115 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
| 115 web_contents_modal_dialog_manager->ShowModalDialog( | 116 web_contents_modal_dialog_manager->ShowModalDialog( |
| 116 window->GetNativeView()); | 117 window->GetNativeView()); |
| 117 } | 118 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 sct_info_view_->SetSignedCertificateTimestamp(*(sct_list_[sct_index].sct), | 185 sct_info_view_->SetSignedCertificateTimestamp(*(sct_list_[sct_index].sct), |
| 185 sct_list_[sct_index].status); | 186 sct_list_[sct_index].status); |
| 186 } | 187 } |
| 187 | 188 |
| 188 void SignedCertificateTimestampsViews::Observe( | 189 void SignedCertificateTimestampsViews::Observe( |
| 189 int type, | 190 int type, |
| 190 const content::NotificationSource& source, | 191 const content::NotificationSource& source, |
| 191 const content::NotificationDetails& details) { | 192 const content::NotificationDetails& details) { |
| 192 GetWidget()->Close(); | 193 GetWidget()->Close(); |
| 193 } | 194 } |
| OLD | NEW |