OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ssl/ssl_tab_helper.h" | 5 #include "chrome/browser/ssl/ssl_tab_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return cert_.get() ? BUTTON_OK : BUTTON_NONE; | 111 return cert_.get() ? BUTTON_OK : BUTTON_NONE; |
112 } | 112 } |
113 | 113 |
114 base::string16 SSLCertResultInfoBarDelegate::GetButtonLabel( | 114 base::string16 SSLCertResultInfoBarDelegate::GetButtonLabel( |
115 InfoBarButton button) const { | 115 InfoBarButton button) const { |
116 DCHECK_EQ(BUTTON_OK, button); | 116 DCHECK_EQ(BUTTON_OK, button); |
117 return l10n_util::GetStringUTF16(IDS_ADD_CERT_SUCCESS_INFOBAR_BUTTON); | 117 return l10n_util::GetStringUTF16(IDS_ADD_CERT_SUCCESS_INFOBAR_BUTTON); |
118 } | 118 } |
119 | 119 |
120 bool SSLCertResultInfoBarDelegate::Accept() { | 120 bool SSLCertResultInfoBarDelegate::Accept() { |
121 ShowCertificateViewer(web_contents(), | 121 content::WebContents* web_contents = |
122 web_contents()->GetView()->GetTopLevelNativeWindow(), | 122 InfoBarService::WebContentsFromInfoBar(infobar()); |
| 123 ShowCertificateViewer(web_contents, |
| 124 web_contents->GetView()->GetTopLevelNativeWindow(), |
123 cert_.get()); | 125 cert_.get()); |
124 return false; // Hiding the infobar just as the dialog opens looks weird. | 126 return false; // Hiding the infobar just as the dialog opens looks weird. |
125 } | 127 } |
126 | 128 |
127 } // namespace | 129 } // namespace |
128 | 130 |
129 | 131 |
130 // SSLTabHelper::SSLAddCertData ------------------------------------------------ | 132 // SSLTabHelper::SSLAddCertData ------------------------------------------------ |
131 | 133 |
132 class SSLTabHelper::SSLAddCertData | 134 class SSLTabHelper::SSLAddCertData |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // Find/create the slot. | 265 // Find/create the slot. |
264 linked_ptr<SSLAddCertData>& ptr_ref = | 266 linked_ptr<SSLAddCertData>& ptr_ref = |
265 request_id_to_add_cert_data_[handler->network_request_id()]; | 267 request_id_to_add_cert_data_[handler->network_request_id()]; |
266 // Fill it if necessary. | 268 // Fill it if necessary. |
267 if (!ptr_ref.get()) { | 269 if (!ptr_ref.get()) { |
268 ptr_ref.reset( | 270 ptr_ref.reset( |
269 new SSLAddCertData(InfoBarService::FromWebContents(web_contents_))); | 271 new SSLAddCertData(InfoBarService::FromWebContents(web_contents_))); |
270 } | 272 } |
271 return ptr_ref.get(); | 273 return ptr_ref.get(); |
272 } | 274 } |
OLD | NEW |