Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2544)

Unified Diff: chrome/browser/safe_browsing/client_side_detection_service.h

Issue 6014003: Intergration of the client-side phishing detection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/client_side_detection_service.h
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h
index af0a2d999ec72445c6da16975127ea15d8494ff3..f8a0e5cd536deed4b99deb282e2e73f46cf24746 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.h
+++ b/chrome/browser/safe_browsing/client_side_detection_service.h
@@ -29,7 +29,11 @@
#include "base/scoped_callback_factory.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
+#include "chrome/common/render_messages_params.h"
#include "chrome/browser/safe_browsing/csd.pb.h"
+#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
+#include "chrome/browser/tab_contents/web_navigation_observer.h"
#include "chrome/common/net/url_fetcher.h"
#include "googleurl/src/gurl.h"
@@ -41,6 +45,36 @@ class URLRequestStatus;
namespace safe_browsing {
+// This class is used to display a phishing interstitial if the client-side
+// phishing detection service classified a particular URL as phishing.
+class CsdClient : public SafeBrowsingService::Client,
lzheng 2011/01/25 00:43:43 Can add comments regarding which thread will call
noelutz 2011/02/10 01:16:23 Done.
+ public WebNavigationObserver {
+ public:
+ CsdClient(int render_process_id, int render_view_id);
+
+ virtual void OnUrlCheckResult(const GURL& url,
Brian Ryner 2011/01/20 23:36:40 Comment that these methods are from SafeBrowsingSe
noelutz 2011/02/10 01:16:23 Done.
+ SafeBrowsingService::UrlCheckResult result);
+ virtual void OnBlockingPageComplete(bool proceed);
+ virtual void MaybeShowPhishingInterstitial(GURL phishing_url,
+ bool is_phishing);
+
+ // From WebNavigationObserver. We want to know if the user navigates away
+ // from the current page. That way when the server verdict comes back we
+ // will not show any interstitial.
+ virtual void DidNavigateMainFramePostCommit(
+ const NavigationController::LoadCommittedDetails& details,
+ const ViewHostMsg_FrameNavigate_Params& params);
+
+ private:
+ // We're taking care of deleting this object. No-one else should delete
+ // this object.
+ ~CsdClient();
+
+ int render_process_id_;
+ int render_view_id_;
+ bool navigated_away_;
+};
Brian Ryner 2011/01/20 23:36:40 DISALLOW_COPY_AND_ASSIGN?
noelutz 2011/02/10 01:16:23 Done.
+
class ClientSideDetectionService : public URLFetcher::Delegate {
public:
typedef Callback1<base::PlatformFile>::Type OpenModelDoneCallback;

Powered by Google App Engine
This is Rietveld 408576698