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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 // Fills the passed dictionary with the strings passed to JS Template when | 90 // Fills the passed dictionary with the strings passed to JS Template when |
91 // creating the HTML. | 91 // creating the HTML. |
92 void PopulateMultipleThreatStringDictionary(DictionaryValue* strings); | 92 void PopulateMultipleThreatStringDictionary(DictionaryValue* strings); |
93 void PopulateMalwareStringDictionary(DictionaryValue* strings); | 93 void PopulateMalwareStringDictionary(DictionaryValue* strings); |
94 void PopulatePhishingStringDictionary(DictionaryValue* strings); | 94 void PopulatePhishingStringDictionary(DictionaryValue* strings); |
95 | 95 |
96 // A helper method used by the Populate methods above used to populate common | 96 // A helper method used by the Populate methods above used to populate common |
97 // fields. | 97 // fields. |
98 void PopulateStringDictionary(DictionaryValue* strings, | 98 void PopulateStringDictionary(DictionaryValue* strings, |
99 const std::wstring& title, | 99 const string16& title, |
100 const std::wstring& headline, | 100 const string16& headline, |
101 const std::wstring& description1, | 101 const string16& description1, |
102 const std::wstring& description2, | 102 const string16& description2, |
103 const std::wstring& description3); | 103 const string16& description3); |
104 | 104 |
105 // Records a user action for this interstitial, using the form | 105 // Records a user action for this interstitial, using the form |
106 // SBInterstitial[Phishing|Malware|Multiple][Show|Proceed|DontProceed]. | 106 // SBInterstitial[Phishing|Malware|Multiple][Show|Proceed|DontProceed]. |
107 void RecordUserAction(BlockingPageEvent event); | 107 void RecordUserAction(BlockingPageEvent event); |
108 | 108 |
109 // See if we should even show the malware details option. For example, we | 109 // See if we should even show the malware details option. For example, we |
110 // don't show it in incognito mode. | 110 // don't show it in incognito mode. |
111 bool CanShowMalwareDetailsOption(); | 111 bool CanShowMalwareDetailsOption(); |
112 | 112 |
113 // Called when the insterstitial is going away. If there is a | 113 // Called when the insterstitial is going away. If there is a |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 public: | 165 public: |
166 virtual ~SafeBrowsingBlockingPageFactory() { } | 166 virtual ~SafeBrowsingBlockingPageFactory() { } |
167 | 167 |
168 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( | 168 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( |
169 SafeBrowsingService* service, | 169 SafeBrowsingService* service, |
170 TabContents* tab_contents, | 170 TabContents* tab_contents, |
171 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; | 171 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0; |
172 }; | 172 }; |
173 | 173 |
174 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ | 174 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_BLOCKING_PAGE_H_ |
OLD | NEW |