| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Classes for managing the SafeBrowsing interstitial pages. | 5 // Classes for managing the SafeBrowsing interstitial pages. |
| 6 // | 6 // |
| 7 // When a user is about to visit a page the SafeBrowsing system has deemed to | 7 // When a user is about to visit a page the SafeBrowsing system has deemed to |
| 8 // be malicious, either as malware or a phishing page, we show an interstitial | 8 // be malicious, either as malware or a phishing page, we show an interstitial |
| 9 // page with some options (go back, continue) to give the user a chance to avoid | 9 // page with some options (go back, continue) to give the user a chance to avoid |
| 10 // the harmful page. | 10 // the harmful page. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 const SafeBrowsingService::UnsafeResource& resource); | 55 const SafeBrowsingService::UnsafeResource& resource); |
| 56 | 56 |
| 57 // Makes the passed |factory| the factory used to instanciate | 57 // Makes the passed |factory| the factory used to instanciate |
| 58 // SafeBrowsingBlockingPage objects. Usefull for tests. | 58 // SafeBrowsingBlockingPage objects. Usefull for tests. |
| 59 static void RegisterFactory(SafeBrowsingBlockingPageFactory* factory) { | 59 static void RegisterFactory(SafeBrowsingBlockingPageFactory* factory) { |
| 60 factory_ = factory; | 60 factory_ = factory; |
| 61 } | 61 } |
| 62 | 62 |
| 63 // InterstitialPage method: | 63 // InterstitialPage method: |
| 64 virtual std::string GetHTMLContents(); | 64 virtual std::string GetHTMLContents(); |
| 65 virtual void SetReportingPreference(bool report); |
| 65 virtual void Proceed(); | 66 virtual void Proceed(); |
| 66 virtual void DontProceed(); | 67 virtual void DontProceed(); |
| 67 | 68 |
| 68 typedef std::vector<SafeBrowsingService::UnsafeResource> UnsafeResourceList; | 69 typedef std::vector<SafeBrowsingService::UnsafeResource> UnsafeResourceList; |
| 69 | 70 |
| 70 protected: | 71 protected: |
| 71 // InterstitialPage method: | 72 // InterstitialPage method: |
| 72 virtual void CommandReceived(const std::string& command); | 73 virtual void CommandReceived(const std::string& command); |
| 73 | 74 |
| 74 // Don't instanciate this class directly, use ShowBlockingPage instead. | 75 // Don't instanciate this class directly, use ShowBlockingPage instead. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 public: | 148 public: |
| 148 virtual ~SafeBrowsingBlockingPageFactory() { } | 149 virtual ~SafeBrowsingBlockingPageFactory() { } |
| 149 | 150 |
| 150 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 151 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
| 151 SafeBrowsingService* service, | 152 SafeBrowsingService* service, |
| 152 TabContents* tab_contents, | 153 TabContents* tab_contents, |
| 153 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 154 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 157 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
| OLD | NEW |