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

@ -1370,14 +1370,12 @@ void NativeWindowViews::ShowAutofillPopup(
bool is_offsceen = false;
bool is_embedder_offscreen = false;
auto* web_contents_preferences =
WebContentsPreferences::FromWebContents(web_contents);
if (web_contents_preferences) {
const auto* web_preferences = web_contents_preferences->dict();
web_preferences->GetBoolean("offscreen", &is_offsceen);
auto* web_preferences = WebContentsPreferences::From(web_contents);
if (web_preferences) {
web_preferences->dict()->GetBoolean("offscreen", &is_offsceen);
int guest_instance_id = 0;
web_preferences->GetInteger(options::kGuestInstanceID, &guest_instance_id);
web_preferences->dict()->GetInteger(options::kGuestInstanceID,
&guest_instance_id);
if (guest_instance_id) {
auto manager = WebViewManager::GetWebViewManager(web_contents);