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 a0571b3314df4b178eb6dc89b0c80990877209fc..39d2881ff21f2f2f1c7c676a341b57be5562b385 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
@@ -588,9 +588,10 @@ 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(); |
+ // 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& active_url = web_contents()->GetLastCommittedURL(); |
Charlie Reis
2013/11/12 01:09:29
nit: current_url
jww
2013/11/12 22:32:50
Done.
|
invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); |
// Log any relevant UI metrics and security exceptions. |