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

Issue 2727813006: Create ChromeAutofillClient in SimpleWebViewDialog

Created:
3 years, 9 months ago by estark
Modified:
3 years, 9 months ago
Reviewers:
meacer
CC:
chromium-reviews, alemate+watch_chromium.org, achuith+watch_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Create ChromeAutofillClient in SimpleWebViewDialog This prevents a crash when a Form-Not-Secure warning is shown on a ChromeOS captive portal login page. BUG=698438

Patch Set 1 #

Patch Set 2 : fix #

Patch Set 3 : fixes #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -1 line) Patch
M chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc View 1 1 chunk +1 line, -0 lines 1 comment Download
M chrome/browser/chromeos/login/ui/simple_web_view_dialog_browsertest.cc View 1 2 3 chunks +31 lines, -1 line 3 comments Download

Messages

Total messages: 15 (12 generated)
estark
meacer PTAL before I send to owners? Thanks!
3 years, 9 months ago (2017-03-04 02:52:26 UTC) #11
meacer
Lgtm with a question https://codereview.chromium.org/2727813006/diff/40001/chrome/browser/chromeos/login/ui/simple_web_view_dialog_browsertest.cc File chrome/browser/chromeos/login/ui/simple_web_view_dialog_browsertest.cc (right): https://codereview.chromium.org/2727813006/diff/40001/chrome/browser/chromeos/login/ui/simple_web_view_dialog_browsertest.cc#newcode64 chrome/browser/chromeos/login/ui/simple_web_view_dialog_browsertest.cc:64: SimpleWebViewDialog* GetSimpleWebViewDialog(CaptivePortalWindowProxy* proxy) { const ...
3 years, 9 months ago (2017-03-04 05:54:15 UTC) #14
meacer
3 years, 9 months ago (2017-03-06 21:10:23 UTC) #15
https://codereview.chromium.org/2727813006/diff/40001/chrome/browser/chromeos...
File chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc (right):

https://codereview.chromium.org/2727813006/diff/40001/chrome/browser/chromeos...
chrome/browser/chromeos/login/ui/simple_web_view_dialog.cc:159:
autofill::ChromeAutofillClient::CreateForWebContents(web_contents);
On closer look, I think this fix is incomplete. It fixes the immediate crash,
but there is another crash:
- Click the username or password form. The "login not secure" autofill entry
shows.
- Move mouse over this entry. Chrome crashes.

This is because autofill_driver is null in
ContentPasswordManagerDriver::GetAutofillAgent(). In order to fix that, you'll
need to create it here as well:


autofill::ChromeAutofillClient::CreateForWebContents(
    web_view_->web_contents());
autofill::ChromeAutofillClient* autofill_client =
    autofill::ChromeAutofillClient::FromWebContents(web_contents);
autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(web_contents,
    autofill_client, g_browser_process->GetApplicationLocale(),
    autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER);

This is why I was asking about a browser test that clicks around :)

Powered by Google App Engine
This is Rietveld 408576698