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

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

Issue 9323071: Use InterstitialPage through a delegate interface instead of deriving from it. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros Created 8 years, 10 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/safe_browsing_blocking_page.h
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_blocking_page.h (revision 120733)
+++ chrome/browser/safe_browsing/safe_browsing_blocking_page.h (working copy)
@@ -33,19 +33,23 @@
#include <vector>
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
-#include "chrome/browser/tab_contents/chrome_interstitial_page.h"
+#include "content/public/browser/interstitial_page_delegate.h"
#include "googleurl/src/gurl.h"
+class InterstitialPage;
+class MalwareDetails;
class MessageLoop;
class SafeBrowsingBlockingPageFactory;
-class MalwareDetails;
-class TabContents;
namespace base {
class DictionaryValue;
}
-class SafeBrowsingBlockingPage : public ChromeInterstitialPage {
+namespace content {
+class WebContents;
+}
+
+class SafeBrowsingBlockingPage : public content::InterstitialPageDelegate {
public:
typedef std::vector<SafeBrowsingService::UnsafeResource> UnsafeResourceList;
typedef std::map<content::WebContents*, UnsafeResourceList> UnsafeResourceMap;
@@ -67,17 +71,20 @@
factory_ = factory;
}
- // ChromeInterstitialPage method:
+ // InterstitialPageDelegate method:
virtual std::string GetHTMLContents() OVERRIDE;
- virtual void Proceed() OVERRIDE;
- virtual void DontProceed() OVERRIDE;
+ virtual void CommandReceived(const std::string& command) OVERRIDE;
+ virtual void OverrideRendererPrefs(
+ content::RendererPreferences* prefs) OVERRIDE;
+ virtual void OnProceed() OVERRIDE;
+ virtual void OnDontProceed() OVERRIDE;
protected:
friend class SafeBrowsingBlockingPageTest;
+ friend class TestSafeBrowsingBlockingPage;
+ FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest,
+ ProceedThenDontProceed);
- // ChromeInterstitialPage method:
- virtual void CommandReceived(const std::string& command) OVERRIDE;
-
void SetReportingPreference(bool report);
// Don't instanciate this class directly, use ShowBlockingPage instead.
@@ -169,6 +176,12 @@
// is gone (if the user enables the feature).
scoped_refptr<MalwareDetails> malware_details_;
+ bool proceeded_;
+
+ content::WebContents* web_contents_;
+ GURL url_;
+ InterstitialPage* interstitial_page_; // Owns us
+
// The factory used to instanciate SafeBrowsingBlockingPage objects.
// Usefull for tests, so they can provide their own implementation of
// SafeBrowsingBlockingPage.
« no previous file with comments | « chrome/browser/renderer_host/offline_resource_throttle.cc ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698