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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc

Issue 962413002: Add type for testing to interstitials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bauerb comments Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 // Implementation of the SafeBrowsingBlockingPage class. 5 // Implementation of the SafeBrowsingBlockingPage class.
6 6
7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 SafeBrowsingBlockingPageFactoryImpl() { } 127 SafeBrowsingBlockingPageFactoryImpl() { }
128 128
129 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageFactoryImpl); 129 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageFactoryImpl);
130 }; 130 };
131 131
132 static base::LazyInstance<SafeBrowsingBlockingPageFactoryImpl> 132 static base::LazyInstance<SafeBrowsingBlockingPageFactoryImpl>
133 g_safe_browsing_blocking_page_factory_impl = LAZY_INSTANCE_INITIALIZER; 133 g_safe_browsing_blocking_page_factory_impl = LAZY_INSTANCE_INITIALIZER;
134 134
135 // static 135 // static
136 const void* SafeBrowsingBlockingPage::kTypeForTesting = 136 content::InterstitialPageDelegate::TypeID
137 &SafeBrowsingBlockingPage::kTypeForTesting; 137 SafeBrowsingBlockingPage::kTypeForTesting =
138 &SafeBrowsingBlockingPage::kTypeForTesting;
138 139
139 SafeBrowsingBlockingPage::SafeBrowsingBlockingPage( 140 SafeBrowsingBlockingPage::SafeBrowsingBlockingPage(
140 SafeBrowsingUIManager* ui_manager, 141 SafeBrowsingUIManager* ui_manager,
141 WebContents* web_contents, 142 WebContents* web_contents,
142 const UnsafeResourceList& unsafe_resources) 143 const UnsafeResourceList& unsafe_resources)
143 : SecurityInterstitialPage(web_contents, unsafe_resources[0].url), 144 : SecurityInterstitialPage(web_contents, unsafe_resources[0].url),
144 malware_details_proceed_delay_ms_( 145 malware_details_proceed_delay_ms_(
145 kMalwareDetailsProceedDelayMilliSeconds), 146 kMalwareDetailsProceedDelayMilliSeconds),
146 ui_manager_(ui_manager), 147 ui_manager_(ui_manager),
147 report_loop_(NULL), 148 report_loop_(NULL),
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 web_contents(), 403 web_contents(),
403 iter->second); 404 iter->second);
404 unsafe_resource_map->erase(iter); 405 unsafe_resource_map->erase(iter);
405 } 406 }
406 407
407 // Now that this interstitial is gone, we can show the new one. 408 // Now that this interstitial is gone, we can show the new one.
408 if (blocking_page) 409 if (blocking_page)
409 blocking_page->Show(); 410 blocking_page->Show();
410 } 411 }
411 412
412 const void* SafeBrowsingBlockingPage::GetTypeForTesting() const { 413 content::InterstitialPageDelegate::TypeID
414 SafeBrowsingBlockingPage::GetTypeForTesting() const {
413 return SafeBrowsingBlockingPage::kTypeForTesting; 415 return SafeBrowsingBlockingPage::kTypeForTesting;
414 } 416 }
415 417
416 bool SafeBrowsingBlockingPage::ShouldCreateNewNavigation() const { 418 bool SafeBrowsingBlockingPage::ShouldCreateNewNavigation() const {
417 return is_main_frame_load_blocked_; 419 return is_main_frame_load_blocked_;
418 } 420 }
419 421
420 void SafeBrowsingBlockingPage::OnDontProceed() { 422 void SafeBrowsingBlockingPage::OnDontProceed() {
421 // We could have already called Proceed(), in which case we must not notify 423 // We could have already called Proceed(), in which case we must not notify
422 // the SafeBrowsingUIManager again, as the client has been deleted. 424 // the SafeBrowsingUIManager again, as the client has been deleted.
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 load_time_data->SetString( 704 load_time_data->SetString(
703 "explanationParagraph", 705 "explanationParagraph",
704 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, 706 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH,
705 GetFormattedHostName())); 707 GetFormattedHostName()));
706 load_time_data->SetString( 708 load_time_data->SetString(
707 "finalParagraph", 709 "finalParagraph",
708 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); 710 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH));
709 711
710 PopulateExtendedReportingOption(load_time_data); 712 PopulateExtendedReportingOption(load_time_data);
711 } 713 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page.h ('k') | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698