Chromium Code Reviews| 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..1356aa24796bdb7f9207481fd78a9e25170a9e1b 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,18 @@ void AutofillDialogControllerImpl::Observe( |
| } |
| //////////////////////////////////////////////////////////////////////////////// |
| +// content::WebContentsObserver implementation. |
|
Ilya Sherman
2013/07/12 23:58:28
nit: Please leave a blank line after this one.
Mike Wittman
2013/07/13 00:16:34
Done.
|
| +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)) |
|
Ilya Sherman
2013/07/12 23:58:28
nit: Please use curly braces, since the if-stmt co
Mike Wittman
2013/07/13 00:16:34
Done.
|
| + Hide(); |
| +} |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| // SuggestionsMenuModelDelegate implementation. |
| void AutofillDialogControllerImpl::SuggestionItemSelected( |
| @@ -2285,7 +2298,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), |