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

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

Issue 7408001: If we show a SafeBrowsing warning we always send the client-side detection (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge Created 9 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/client_side_detection_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/client_side_detection_host.h
diff --git a/chrome/browser/safe_browsing/client_side_detection_host.h b/chrome/browser/safe_browsing/client_side_detection_host.h
index 6276bc80724d6be87f733b8613b32d7a7d958633..1d0b15e58f6422a0a440dac33e04aaa96cc380d1 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host.h
+++ b/chrome/browser/safe_browsing/client_side_detection_host.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/safe_browsing/browser_feature_extractor.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/tab_contents_observer.h"
#include "content/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
@@ -30,7 +31,8 @@ class ClientSideDetectionService;
// class which sends a ping to a server to validate the verdict.
// TODO(noelutz): move all client-side detection IPCs to this class.
class ClientSideDetectionHost : public TabContentsObserver,
- public NotificationObserver {
+ public NotificationObserver,
+ public SafeBrowsingService::Observer {
public:
// The caller keeps ownership of the tab object and is responsible for
// ensuring that it stays valid until TabContentsDestroyed is called.
@@ -47,6 +49,11 @@ class ClientSideDetectionHost : public TabContentsObserver,
const content::LoadCommittedDetails& details,
const ViewHostMsg_FrameNavigate_Params& params);
+ // Called when the SafeBrowsingService found a hit with one of the
+ // SafeBrowsing lists. This method is called on the UI thread.
+ virtual void OnSafeBrowsingHit(
+ const SafeBrowsingService::UnsafeResource& resource);
+
protected:
// From TabContentsObserver. Called when the TabContents is being destroyed.
virtual void TabContentsDestroyed(TabContents* tab);
@@ -59,7 +66,7 @@ class ClientSideDetectionHost : public TabContentsObserver,
explicit ClientSideDetectionHost(TabContents* tab);
// Verdict is an encoded ClientPhishingRequest protocol message.
- void OnDetectedPhishingSite(const std::string& verdict);
+ void OnPhishingDetectionDone(const std::string& verdict);
// Callback that is called when the server ping back is
// done. Display an interstitial if |is_phishing| is true.
@@ -77,6 +84,12 @@ class ClientSideDetectionHost : public TabContentsObserver,
const NotificationSource& source,
const NotificationDetails& details);
+ // Returns true if the user has seen a regular SafeBrowsing
+ // interstitial for the current page. This is only true if the user has
+ // actually clicked through the warning. This method is called on the UI
+ // thread.
+ bool DidShowSBInterstitial();
+
// Used for testing. This function does not take ownership of the service
// class.
void set_client_side_detection_service(ClientSideDetectionService* service);
@@ -104,6 +117,9 @@ class ClientSideDetectionHost : public TabContentsObserver,
base::ScopedCallbackFactory<ClientSideDetectionHost> cb_factory_;
+ // Unique page ID of the most recent unsafe site that was loaded in this tab.
+ int unsafe_unique_page_id_;
+
DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionHost);
};
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/client_side_detection_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698