| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/offline_pages/offline_page_mhtml_archiver.h" | 5 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 base::Bind(callback_, this, ArchiverResult::SUCCESSFULLY_CREATED, url, | 157 base::Bind(callback_, this, ArchiverResult::SUCCESSFULLY_CREATED, url, |
| 158 file_path, title, file_size)); | 158 file_path, title, file_size)); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool OfflinePageMHTMLArchiver::HasConnectionSecurityError() { | 162 bool OfflinePageMHTMLArchiver::HasConnectionSecurityError() { |
| 163 ChromeSecurityStateModelClient::CreateForWebContents(web_contents_); | 163 ChromeSecurityStateModelClient::CreateForWebContents(web_contents_); |
| 164 ChromeSecurityStateModelClient* model_client = | 164 ChromeSecurityStateModelClient* model_client = |
| 165 ChromeSecurityStateModelClient::FromWebContents(web_contents_); | 165 ChromeSecurityStateModelClient::FromWebContents(web_contents_); |
| 166 DCHECK(model_client); | 166 DCHECK(model_client); |
| 167 security_state::SecurityStateModel::SecurityInfo security_info; |
| 168 model_client->GetSecurityInfo(&security_info); |
| 167 return security_state::SecurityStateModel::SecurityLevel::SECURITY_ERROR == | 169 return security_state::SecurityStateModel::SecurityLevel::SECURITY_ERROR == |
| 168 model_client->GetSecurityInfo().security_level; | 170 security_info.security_level; |
| 169 } | 171 } |
| 170 | 172 |
| 171 void OfflinePageMHTMLArchiver::ReportFailure(ArchiverResult result) { | 173 void OfflinePageMHTMLArchiver::ReportFailure(ArchiverResult result) { |
| 172 DCHECK(result != ArchiverResult::SUCCESSFULLY_CREATED); | 174 DCHECK(result != ArchiverResult::SUCCESSFULLY_CREATED); |
| 173 base::ThreadTaskRunnerHandle::Get()->PostTask( | 175 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 174 FROM_HERE, base::Bind(callback_, this, result, GURL(), base::FilePath(), | 176 FROM_HERE, base::Bind(callback_, this, result, GURL(), base::FilePath(), |
| 175 base::string16(), 0)); | 177 base::string16(), 0)); |
| 176 } | 178 } |
| 177 | 179 |
| 178 } // namespace offline_pages | 180 } // namespace offline_pages |
| OLD | NEW |