| Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
|
| diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
|
| index 673293edfc58ba5da177e248cbf9ba67fc05f787..291b163fa6ae51ae4fdcbd9bcc12f3e78be24101 100644
|
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
|
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
|
| @@ -67,6 +67,7 @@
|
| #include "grit/generated_resources.h"
|
| #include "grit/theme_resources.h"
|
| #include "grit/webkit_resources.h"
|
| +#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
| #include "net/cert/cert_status_flags.h"
|
| #include "ui/base/base_window.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| @@ -2016,6 +2017,20 @@ void AutofillDialogControllerImpl::Observe(
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| +// content::WebContentsObserver implementation.
|
| +
|
| +void AutofillDialogControllerImpl::DidNavigateMainFrame(
|
| + const content::LoadCommittedDetails& details,
|
| + const content::FrameNavigateParams& params) {
|
| + // Close view if necessary.
|
| + if (!net::registry_controlled_domains::SameDomainOrHost(
|
| + details.previous_url, details.entry->GetURL(),
|
| + net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES)) {
|
| + Hide();
|
| + }
|
| +}
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| // SuggestionsMenuModelDelegate implementation.
|
|
|
| void AutofillDialogControllerImpl::SuggestionItemSelected(
|
| @@ -2285,7 +2300,8 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl(
|
| const DialogType dialog_type,
|
| const base::Callback<void(const FormStructure*,
|
| const std::string&)>& callback)
|
| - : profile_(Profile::FromBrowserContext(contents->GetBrowserContext())),
|
| + : WebContentsObserver(contents),
|
| + profile_(Profile::FromBrowserContext(contents->GetBrowserContext())),
|
| contents_(contents),
|
| initial_user_state_(AutofillMetrics::DIALOG_USER_STATE_UNKNOWN),
|
| dialog_type_(dialog_type),
|
|
|