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 // This class is used by the RenderView to interact with a PhishingClassifier. | 5 // This class is used by the RenderView to interact with a PhishingClassifier. |
6 | 6 |
7 #ifndef CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_DELEGATE_H_ | 7 #ifndef CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_DELEGATE_H_ |
8 #define CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_DELEGATE_H_ | 8 #define CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_DELEGATE_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 SHUTDOWN, | 77 SHUTDOWN, |
78 NEW_PHISHING_SCORER, | 78 NEW_PHISHING_SCORER, |
79 CANCEL_CLASSIFICATION_MAX // Always add new values before this one. | 79 CANCEL_CLASSIFICATION_MAX // Always add new values before this one. |
80 }; | 80 }; |
81 | 81 |
82 // Cancels any pending classification and frees the page text. | 82 // Cancels any pending classification and frees the page text. |
83 void CancelPendingClassification(CancelClassificationReason reason); | 83 void CancelPendingClassification(CancelClassificationReason reason); |
84 | 84 |
85 // RenderFrameObserver implementation. | 85 // RenderFrameObserver implementation. |
86 bool OnMessageReceived(const IPC::Message& message) override; | 86 bool OnMessageReceived(const IPC::Message& message) override; |
| 87 void OnDestruct() override; |
87 | 88 |
88 // Called by the RenderFrame when it receives a StartPhishingDetection IPC | 89 // Called by the RenderFrame when it receives a StartPhishingDetection IPC |
89 // from the browser. This signals that it is ok to begin classification | 90 // from the browser. This signals that it is ok to begin classification |
90 // for the given toplevel URL. If the URL has been fully loaded into the | 91 // for the given toplevel URL. If the URL has been fully loaded into the |
91 // RenderFrame and a Scorer has been set, this will begin classification, | 92 // RenderFrame and a Scorer has been set, this will begin classification, |
92 // otherwise classification will be deferred until these conditions are met. | 93 // otherwise classification will be deferred until these conditions are met. |
93 void OnStartPhishingDetection(const GURL& url); | 94 void OnStartPhishingDetection(const GURL& url); |
94 | 95 |
95 // Called when classification for the current page finishes. | 96 // Called when classification for the current page finishes. |
96 void ClassificationDone(const ClientPhishingRequest& verdict); | 97 void ClassificationDone(const ClientPhishingRequest& verdict); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 136 |
136 // Set to true if the classifier is currently running. | 137 // Set to true if the classifier is currently running. |
137 bool is_classifying_; | 138 bool is_classifying_; |
138 | 139 |
139 DISALLOW_COPY_AND_ASSIGN(PhishingClassifierDelegate); | 140 DISALLOW_COPY_AND_ASSIGN(PhishingClassifierDelegate); |
140 }; | 141 }; |
141 | 142 |
142 } // namespace safe_browsing | 143 } // namespace safe_browsing |
143 | 144 |
144 #endif // CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_DELEGATE_H_ | 145 #endif // CHROME_RENDERER_SAFE_BROWSING_PHISHING_CLASSIFIER_DELEGATE_H_ |
OLD | NEW |