| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 explicit SSLAddCertData(content::WebContents* contents); | 137 explicit SSLAddCertData(content::WebContents* contents); |
| 138 virtual ~SSLAddCertData(); | 138 virtual ~SSLAddCertData(); |
| 139 | 139 |
| 140 // Displays an infobar, replacing |infobar_delegate_| if it exists. | 140 // Displays an infobar, replacing |infobar_delegate_| if it exists. |
| 141 void ShowInfoBar(const string16& message, net::X509Certificate* cert); | 141 void ShowInfoBar(const string16& message, net::X509Certificate* cert); |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 // content::NotificationObserver: | 144 // content::NotificationObserver: |
| 145 virtual void Observe(int type, | 145 virtual void Observe(int type, |
| 146 const content::NotificationSource& source, | 146 const content::NotificationSource& source, |
| 147 const content::NotificationDetails& details); | 147 const content::NotificationDetails& details) OVERRIDE; |
| 148 | 148 |
| 149 InfoBarService* infobar_service_; | 149 InfoBarService* infobar_service_; |
| 150 InfoBarDelegate* infobar_delegate_; | 150 InfoBarDelegate* infobar_delegate_; |
| 151 content::NotificationRegistrar registrar_; | 151 content::NotificationRegistrar registrar_; |
| 152 | 152 |
| 153 DISALLOW_COPY_AND_ASSIGN(SSLAddCertData); | 153 DISALLOW_COPY_AND_ASSIGN(SSLAddCertData); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 SSLTabHelper::SSLAddCertData::SSLAddCertData(content::WebContents* contents) | 156 SSLTabHelper::SSLAddCertData::SSLAddCertData(content::WebContents* contents) |
| 157 : infobar_service_(InfoBarService::FromWebContents(contents)), | 157 : infobar_service_(InfoBarService::FromWebContents(contents)), |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 SSLTabHelper::SSLAddCertData* | 255 SSLTabHelper::SSLAddCertData* |
| 256 SSLTabHelper::GetAddCertData(SSLAddCertHandler* handler) { | 256 SSLTabHelper::GetAddCertData(SSLAddCertHandler* handler) { |
| 257 // Find/create the slot. | 257 // Find/create the slot. |
| 258 linked_ptr<SSLAddCertData>& ptr_ref = | 258 linked_ptr<SSLAddCertData>& ptr_ref = |
| 259 request_id_to_add_cert_data_[handler->network_request_id()]; | 259 request_id_to_add_cert_data_[handler->network_request_id()]; |
| 260 // Fill it if necessary. | 260 // Fill it if necessary. |
| 261 if (!ptr_ref.get()) | 261 if (!ptr_ref.get()) |
| 262 ptr_ref.reset(new SSLAddCertData(web_contents_)); | 262 ptr_ref.reset(new SSLAddCertData(web_contents_)); |
| 263 return ptr_ref.get(); | 263 return ptr_ref.get(); |
| 264 } | 264 } |
| OLD | NEW |