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 34e39142609d230034e4e16546507e11aee47497..22bef08e98741d7a94d0e40aecbfc4d334c3e1ee 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| @@ -588,10 +588,12 @@ base::WeakPtr<AutofillDialogController> AutofillDialogController::Create( |
| void AutofillDialogControllerImpl::Show() { |
| dialog_shown_timestamp_ = base::Time::Now(); |
| - content::NavigationEntry* entry = |
| - web_contents()->GetController().GetActiveEntry(); |
| - const GURL& active_url = entry ? entry->GetURL() : web_contents()->GetURL(); |
| - invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); |
| + // Autocomplete is shown in response to a message from the renderer. As such, |
| + // it can only be made in the context of the current document and we must use |
| + // last committed URL for access checks. |
| + const GURL& current_url = web_contents()->GetLastCommittedURL(); |
| + invoked_from_same_origin_ = |
| + current_url.GetOrigin() == source_url_.GetOrigin(); |
| // Log any relevant UI metrics and security exceptions. |
| GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN); |
| @@ -650,17 +652,18 @@ void AutofillDialogControllerImpl::Show() { |
| SubmitButtonDelayBegin(); |
| - if (account_chooser_model_.WalletIsSelected()) |
|
Charlie Reis
2013/11/16 19:13:16
Is this a merge conflict? I don't think you want
|
| - FetchWalletCookie(); |
| - |
| // TODO(estade): don't show the dialog if the site didn't specify the right |
| // fields. First we must figure out what the "right" fields are. |
| view_.reset(CreateView()); |
| view_->Show(); |
| GetManager()->AddObserver(this); |
| - if (!account_chooser_model_.WalletIsSelected()) |
| + if (!account_chooser_model_.WalletIsSelected()) { |
| LogDialogLatencyToShow(); |
| + } else { |
|
Charlie Reis
2013/11/16 19:13:16
Another merge conflict?
|
| + // TODO(aruslan): UMA metrics for sign-in. |
| + FetchWalletCookie(); |
| + } |
| } |
| void AutofillDialogControllerImpl::Hide() { |