| 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/renderer/safe_browsing/phishing_classifier_delegate.h" | 5 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 void PhishingClassifierDelegate::OnStartPhishingDetection(const GURL& url) { | 138 void PhishingClassifierDelegate::OnStartPhishingDetection(const GURL& url) { |
| 139 last_url_received_from_browser_ = StripRef(url); | 139 last_url_received_from_browser_ = StripRef(url); |
| 140 // Start classifying the current page if all conditions are met. | 140 // Start classifying the current page if all conditions are met. |
| 141 // See MaybeStartClassification() for details. | 141 // See MaybeStartClassification() for details. |
| 142 MaybeStartClassification(); | 142 MaybeStartClassification(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void PhishingClassifierDelegate::DidCommitProvisionalLoad( | 145 void PhishingClassifierDelegate::DidCommitProvisionalLoad( |
| 146 bool is_new_navigation, | 146 bool is_new_navigation, |
| 147 bool is_same_page_navigation) { | 147 bool is_same_document_navigation) { |
| 148 blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); | 148 blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); |
| 149 // A new page is starting to load, so cancel classificaiton. | 149 // A new page is starting to load, so cancel classificaiton. |
| 150 // | 150 // |
| 151 // TODO(bryner): We shouldn't need to cancel classification if the navigation | 151 // TODO(bryner): We shouldn't need to cancel classification if the navigation |
| 152 // is within the same document. However, if we let classification continue in | 152 // is within the same document. However, if we let classification continue in |
| 153 // this case, we need to properly deal with the fact that PageCaptured will | 153 // this case, we need to properly deal with the fact that PageCaptured will |
| 154 // be called again for the same-document navigation. We need to be sure not | 154 // be called again for the same-document navigation. We need to be sure not |
| 155 // to swap out the page text while the term feature extractor is still | 155 // to swap out the page text while the term feature extractor is still |
| 156 // running. | 156 // running. |
| 157 DocumentState* document_state = DocumentState::FromDataSource( | 157 DocumentState* document_state = DocumentState::FromDataSource( |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 &classifier_page_text_, | 288 &classifier_page_text_, |
| 289 base::Bind(&PhishingClassifierDelegate::ClassificationDone, | 289 base::Bind(&PhishingClassifierDelegate::ClassificationDone, |
| 290 base::Unretained(this))); | 290 base::Unretained(this))); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void PhishingClassifierDelegate::OnDestruct() { | 293 void PhishingClassifierDelegate::OnDestruct() { |
| 294 delete this; | 294 delete this; |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace safe_browsing | 297 } // namespace safe_browsing |
| OLD | NEW |