OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
7 #include "chrome/browser/safe_browsing/malware_details.h" | 7 #include "chrome/browser/safe_browsing/malware_details.h" |
8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
10 #include "chrome/browser/safe_browsing/ui_manager.h" | 10 #include "chrome/browser/safe_browsing/ui_manager.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 WebContentsTester::For(web_contents())->TestDidNavigate( | 168 WebContentsTester::For(web_contents())->TestDidNavigate( |
169 rvh, | 169 rvh, |
170 entry->GetPageID(), | 170 entry->GetPageID(), |
171 GURL(entry->GetURL()), | 171 GURL(entry->GetURL()), |
172 content::PAGE_TRANSITION_TYPED); | 172 content::PAGE_TRANSITION_TYPED); |
173 } | 173 } |
174 | 174 |
175 void ShowInterstitial(bool is_subresource, const char* url) { | 175 void ShowInterstitial(bool is_subresource, const char* url) { |
176 SafeBrowsingUIManager::UnsafeResource resource; | 176 SafeBrowsingUIManager::UnsafeResource resource; |
177 InitResource(&resource, is_subresource, GURL(url)); | 177 InitResource(&resource, is_subresource, GURL(url)); |
178 SafeBrowsingBlockingPage::ShowBlockingPage(ui_manager_, resource); | 178 SafeBrowsingBlockingPage::ShowBlockingPage(ui_manager_.get(), resource); |
179 } | 179 } |
180 | 180 |
181 // Returns the SafeBrowsingBlockingPage currently showing or NULL if none is | 181 // Returns the SafeBrowsingBlockingPage currently showing or NULL if none is |
182 // showing. | 182 // showing. |
183 SafeBrowsingBlockingPage* GetSafeBrowsingBlockingPage() { | 183 SafeBrowsingBlockingPage* GetSafeBrowsingBlockingPage() { |
184 InterstitialPage* interstitial = | 184 InterstitialPage* interstitial = |
185 InterstitialPage::GetInterstitialPage(web_contents()); | 185 InterstitialPage::GetInterstitialPage(web_contents()); |
186 if (!interstitial) | 186 if (!interstitial) |
187 return NULL; | 187 return NULL; |
188 return static_cast<SafeBrowsingBlockingPage*>( | 188 return static_cast<SafeBrowsingBlockingPage*>( |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 664 |
665 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( | 665 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( |
666 prefs::kSafeBrowsingReportingEnabled)); | 666 prefs::kSafeBrowsingReportingEnabled)); |
667 | 667 |
668 // Simulate the user uncheck the report agreement checkbox. | 668 // Simulate the user uncheck the report agreement checkbox. |
669 sb_interstitial->SetReportingPreference(false); | 669 sb_interstitial->SetReportingPreference(false); |
670 | 670 |
671 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( | 671 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( |
672 prefs::kSafeBrowsingReportingEnabled)); | 672 prefs::kSafeBrowsingReportingEnabled)); |
673 } | 673 } |
OLD | NEW |