| 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/safe_browsing/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 | 196 |
| 197 ACTION_P(CheckDownloadUrlDone, threat_type) { | 197 ACTION_P(CheckDownloadUrlDone, threat_type) { |
| 198 // TODO(nparker): Remove use of SafeBrowsingCheck and instead call | 198 // TODO(nparker): Remove use of SafeBrowsingCheck and instead call |
| 199 // client->OnCheckDownloadUrlResult(..) directly. | 199 // client->OnCheckDownloadUrlResult(..) directly. |
| 200 LocalSafeBrowsingDatabaseManager::SafeBrowsingCheck* check = | 200 LocalSafeBrowsingDatabaseManager::SafeBrowsingCheck* check = |
| 201 new LocalSafeBrowsingDatabaseManager::SafeBrowsingCheck( | 201 new LocalSafeBrowsingDatabaseManager::SafeBrowsingCheck( |
| 202 arg0, | 202 arg0, |
| 203 std::vector<SBFullHash>(), | 203 std::vector<SBFullHash>(), |
| 204 arg1, | 204 arg1, |
| 205 safe_browsing::BINURL, | 205 safe_browsing_util::BINURL, |
| 206 std::vector<SBThreatType>(1, SB_THREAT_TYPE_BINARY_MALWARE_URL)); | 206 std::vector<SBThreatType>(1, SB_THREAT_TYPE_BINARY_MALWARE_URL)); |
| 207 for (size_t i = 0; i < check->url_results.size(); ++i) | 207 for (size_t i = 0; i < check->url_results.size(); ++i) |
| 208 check->url_results[i] = threat_type; | 208 check->url_results[i] = threat_type; |
| 209 BrowserThread::PostTask(BrowserThread::IO, | 209 BrowserThread::PostTask(BrowserThread::IO, |
| 210 FROM_HERE, | 210 FROM_HERE, |
| 211 base::Bind(&OnSafeBrowsingResult, | 211 base::Bind(&OnSafeBrowsingResult, |
| 212 base::Owned(check))); | 212 base::Owned(check))); |
| 213 } | 213 } |
| 214 | 214 |
| 215 class DownloadProtectionServiceTest : public testing::Test { | 215 class DownloadProtectionServiceTest : public testing::Test { |
| (...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1952 | 1952 |
| 1953 EXPECT_CALL(mock_download_item, GetDangerType()) | 1953 EXPECT_CALL(mock_download_item, GetDangerType()) |
| 1954 .WillOnce(Return(content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST)); | 1954 .WillOnce(Return(content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST)); |
| 1955 EXPECT_CALL(mock_page_navigator, OpenURL(OpenURLParamsWithContextValue("7"))); | 1955 EXPECT_CALL(mock_page_navigator, OpenURL(OpenURLParamsWithContextValue("7"))); |
| 1956 | 1956 |
| 1957 download_service_->ShowDetailsForDownload(mock_download_item, | 1957 download_service_->ShowDetailsForDownload(mock_download_item, |
| 1958 &mock_page_navigator); | 1958 &mock_page_navigator); |
| 1959 } | 1959 } |
| 1960 | 1960 |
| 1961 } // namespace safe_browsing | 1961 } // namespace safe_browsing |
| OLD | NEW |