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

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

Issue 2890703002: SafeBrowsing: allow WebView to customize the Help Center URL (Closed)
Patch Set: Rebase and fix compile errors, no logic change Created 3 years, 7 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 "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 22 matching lines...) Expand all
33 namespace safe_browsing { 33 namespace safe_browsing {
34 34
35 namespace { 35 namespace {
36 36
37 // Constants for the Experience Sampling instrumentation. 37 // Constants for the Experience Sampling instrumentation.
38 const char kEventNameMalware[] = "safebrowsing_interstitial_"; 38 const char kEventNameMalware[] = "safebrowsing_interstitial_";
39 const char kEventNameHarmful[] = "harmful_interstitial_"; 39 const char kEventNameHarmful[] = "harmful_interstitial_";
40 const char kEventNamePhishing[] = "phishing_interstitial_"; 40 const char kEventNamePhishing[] = "phishing_interstitial_";
41 const char kEventNameOther[] = "safebrowsing_other_interstitial_"; 41 const char kEventNameOther[] = "safebrowsing_other_interstitial_";
42 42
43 const char kHelpCenterLink[] = "cpn_safe_browsing";
44
43 } // namespace 45 } // namespace
44 46
45 // static 47 // static
46 SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL; 48 SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL;
47 49
48 // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we 50 // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we
49 // don't leak it. 51 // don't leak it.
50 class SafeBrowsingBlockingPageFactoryImpl 52 class SafeBrowsingBlockingPageFactoryImpl
51 : public SafeBrowsingBlockingPageFactory { 53 : public SafeBrowsingBlockingPageFactory {
52 public: 54 public:
(...skipping 16 matching lines...) Expand all
69 // interstitial. This must happen before querying IsScout to populate the 71 // interstitial. This must happen before querying IsScout to populate the
70 // Display Options below. 72 // Display Options below.
71 safe_browsing::UpdatePrefsBeforeSecurityInterstitial(prefs); 73 safe_browsing::UpdatePrefsBeforeSecurityInterstitial(prefs);
72 74
73 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options( 75 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options(
74 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources), 76 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
75 is_extended_reporting_opt_in_allowed, 77 is_extended_reporting_opt_in_allowed,
76 web_contents->GetBrowserContext()->IsOffTheRecord(), 78 web_contents->GetBrowserContext()->IsOffTheRecord(),
77 IsExtendedReportingEnabled(*prefs), IsScout(*prefs), 79 IsExtendedReportingEnabled(*prefs), IsScout(*prefs),
78 is_proceed_anyway_disabled, 80 is_proceed_anyway_disabled,
79 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources)); 81 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
82 kHelpCenterLink);
80 83
81 return new SafeBrowsingBlockingPage(ui_manager, web_contents, 84 return new SafeBrowsingBlockingPage(ui_manager, web_contents,
82 main_frame_url, unsafe_resources, 85 main_frame_url, unsafe_resources,
83 display_options); 86 display_options);
84 } 87 }
85 88
86 private: 89 private:
87 friend struct base::LazyInstanceTraitsBase< 90 friend struct base::LazyInstanceTraitsBase<
88 SafeBrowsingBlockingPageFactoryImpl>; 91 SafeBrowsingBlockingPageFactoryImpl>;
89 92
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 web_contents, unsafe_resources[0].url, 276 web_contents, unsafe_resources[0].url,
274 GetReportingInfo(unsafe_resources), 277 GetReportingInfo(unsafe_resources),
275 GetSamplingEventName(GetInterstitialReason(unsafe_resources))); 278 GetSamplingEventName(GetInterstitialReason(unsafe_resources)));
276 279
277 return base::MakeUnique<SecurityInterstitialControllerClient>( 280 return base::MakeUnique<SecurityInterstitialControllerClient>(
278 web_contents, std::move(metrics_helper), profile->GetPrefs(), 281 web_contents, std::move(metrics_helper), profile->GetPrefs(),
279 ui_manager->app_locale(), ui_manager->default_safe_page()); 282 ui_manager->app_locale(), ui_manager->default_safe_page());
280 } 283 }
281 284
282 } // namespace safe_browsing 285 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698