Remove the static getter methods from WebContentsPreferences

This commit is contained in:
Cheng Zhao 2018-03-08 16:36:21 +09:00
parent 887bc12350
commit 3d47a8a2fd
7 changed files with 60 additions and 82 deletions

View file

@ -80,9 +80,10 @@ void OnPdfResourceIntercepted(
if (!web_contents)
return;
if (!WebContentsPreferences::IsPreferenceEnabled("plugins", web_contents)) {
auto browser_context = web_contents->GetBrowserContext();
auto download_manager =
auto* web_preferences = WebContentsPreferences::From(web_contents);
if (!web_preferences || !web_preferences->IsEnabled("plugins")) {
auto* browser_context = web_contents->GetBrowserContext();
auto* download_manager =
content::BrowserContext::GetDownloadManager(browser_context);
download_manager->DownloadUrl(