Add WebContentsPreferences::From that checks parameter

This commit is contained in:
Cheng Zhao 2018-03-08 16:12:45 +09:00
parent 9772777919
commit 887bc12350
7 changed files with 21 additions and 15 deletions

View file

@ -235,8 +235,7 @@ void AtomBrowserClient::OverrideSiteInstanceForNavigation(
// Do we have an affinity site to manage ?
std::string affinity;
auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
auto* web_preferences = web_contents ?
WebContentsPreferences::FromWebContents(web_contents) : nullptr;
auto* web_preferences = WebContentsPreferences::From(web_contents);
if (web_preferences &&
web_preferences->dict()->GetString("affinity", &affinity) &&
!affinity.empty()) {