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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 74563003: Removed some GetActiveEntry references in autofill (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed merge conflict Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 3465f8d0ebc537627c72adbbbacf192f8d0cf95e..2e404e234370cbbf44b9f85f2dd92a7802a88cec 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -578,8 +578,12 @@ void AutofillDialogControllerImpl::Show() {
content::NavigationEntry* entry =
web_contents()->GetController().GetActiveEntry();
Charlie Reis 2013/11/19 21:49:15 Your previous patch deleted this line, since it's
jww 2013/11/19 22:00:00 Done.
- const GURL& active_url = entry ? entry->GetURL() : web_contents()->GetURL();
- invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin();
+ // Autocomplete is show 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
+ // the 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);

Powered by Google App Engine
This is Rietveld 408576698