| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/client_side_detection_service.h" | 5 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 } | 183 } |
| 184 return false; | 184 return false; |
| 185 } | 185 } |
| 186 | 186 |
| 187 void ClientSideDetectionService::OnURLFetchComplete( | 187 void ClientSideDetectionService::OnURLFetchComplete( |
| 188 const content::URLFetcher* source) { | 188 const content::URLFetcher* source) { |
| 189 std::string data; | 189 std::string data; |
| 190 source->GetResponseAsString(&data); | 190 source->GetResponseAsString(&data); |
| 191 if (source == model_fetcher_.get()) { | 191 if (source == model_fetcher_.get()) { |
| 192 HandleModelResponse( | 192 HandleModelResponse( |
| 193 source, source->GetUrl(), source->GetStatus(), | 193 source, source->GetURL(), source->GetStatus(), |
| 194 source->GetResponseCode(), source->GetCookies(), data); | 194 source->GetResponseCode(), source->GetCookies(), data); |
| 195 } else if (client_phishing_reports_.find(source) != | 195 } else if (client_phishing_reports_.find(source) != |
| 196 client_phishing_reports_.end()) { | 196 client_phishing_reports_.end()) { |
| 197 HandlePhishingVerdict( | 197 HandlePhishingVerdict( |
| 198 source, source->GetUrl(), source->GetStatus(), | 198 source, source->GetURL(), source->GetStatus(), |
| 199 source->GetResponseCode(), source->GetCookies(), data); | 199 source->GetResponseCode(), source->GetCookies(), data); |
| 200 } else { | 200 } else { |
| 201 NOTREACHED(); | 201 NOTREACHED(); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 void ClientSideDetectionService::Observe( | 205 void ClientSideDetectionService::Observe( |
| 206 int type, | 206 int type, |
| 207 const content::NotificationSource& source, | 207 const content::NotificationSource& source, |
| 208 const content::NotificationDetails& details) { | 208 const content::NotificationDetails& details) { |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 &whitelist_patterns); | 573 &whitelist_patterns); |
| 574 for (size_t j = 0; j < whitelist_patterns.size(); ++j) { | 574 for (size_t j = 0; j < whitelist_patterns.size(); ++j) { |
| 575 if (whitelist_patterns[j] == canonical_url_as_pattern) { | 575 if (whitelist_patterns[j] == canonical_url_as_pattern) { |
| 576 return true; | 576 return true; |
| 577 } | 577 } |
| 578 } | 578 } |
| 579 } | 579 } |
| 580 return false; | 580 return false; |
| 581 } | 581 } |
| 582 } // namespace safe_browsing | 582 } // namespace safe_browsing |
| OLD | NEW |