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

Unified Diff: components/security_interstitials/content/security_interstitial_page.cc

Issue 2627343003: Update prefservice only if it is available. (Closed)
Patch Set: address code review Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/security_interstitials/content/security_interstitial_page.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/security_interstitials/content/security_interstitial_page.cc
diff --git a/components/security_interstitials/content/security_interstitial_page.cc b/components/security_interstitials/content/security_interstitial_page.cc
index 6ff9b3a9ac5a82ac4f91ea2164dcbf8362ed3e07..c3fefb5699ce3ea238e4c39e44c2af78ea3bc743 100644
--- a/components/security_interstitials/content/security_interstitial_page.cc
+++ b/components/security_interstitials/content/security_interstitial_page.cc
@@ -34,9 +34,12 @@ SecurityInterstitialPage::SecurityInterstitialPage(
create_view_(true),
controller_(std::move(controller)) {
// Determine if any prefs need to be updated prior to showing the security
- // interstitial.
- safe_browsing::UpdatePrefsBeforeSecurityInterstitial(
- controller_->GetPrefService());
+ // interstitial. Note that some content embedders (such as Android WebView)
+ // uses security interstitials without a prefservice.
+ if (controller_->GetPrefService()) {
+ safe_browsing::UpdatePrefsBeforeSecurityInterstitial(
+ controller_->GetPrefService());
+ }
// Creating interstitial_page_ without showing it leaks memory, so don't
// create it here.
@@ -74,10 +77,6 @@ void SecurityInterstitialPage::Show() {
AfterShow();
}
-bool SecurityInterstitialPage::IsPrefEnabled(const char* pref) {
- return controller_->GetPrefService()->GetBoolean(pref);
-}
-
SecurityInterstitialControllerClient* SecurityInterstitialPage::controller() {
return controller_.get();
}
« no previous file with comments | « components/security_interstitials/content/security_interstitial_page.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698