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

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

Issue 22882007: Remove GetActiveEntry usage from chrome/browser/ui. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT. Created 7 years, 2 months 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 90a99aeed2f4836149ae14e8ca66503aa932390b..2ca70803caa2a59f8dd5840a4f0d72b95e6ff1bd 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -639,9 +639,10 @@ void AutofillDialogController::RegisterProfilePrefs(
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();
invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin();
// Log any relevant UI metrics and security exceptions.
« no previous file with comments | « chrome/browser/ui/android/autofill/autofill_dialog_controller_android.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698