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

Side by Side 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: Improved comment in Show() 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/android/autofill/autofill_dialog_controller_android.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 const base::Callback<void(const FormStructure*)>& callback) { 569 const base::Callback<void(const FormStructure*)>& callback) {
570 return AutofillDialogControllerImpl::Create(contents, 570 return AutofillDialogControllerImpl::Create(contents,
571 form_structure, 571 form_structure,
572 source_url, 572 source_url,
573 callback); 573 callback);
574 } 574 }
575 575
576 void AutofillDialogControllerImpl::Show() { 576 void AutofillDialogControllerImpl::Show() {
577 dialog_shown_timestamp_ = base::Time::Now(); 577 dialog_shown_timestamp_ = base::Time::Now();
578 578
579 content::NavigationEntry* entry = 579 // Autocomplete is shown in response to a message from the renderer and as
Ilya Sherman 2013/11/19 23:43:13 nit: "Autocomplete" -> "The Autofill dialog"
jww 2013/11/19 23:52:08 Done.
580 web_contents()->GetController().GetActiveEntry(); 580 // such, it can only be made in the context of the current document. A call to
581 const GURL& active_url = entry ? entry->GetURL() : web_contents()->GetURL(); 581 // GetActiveEntry would return a pending entry, if there was one, which would
582 invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); 582 // be a security bug. Therefore, we must use the last committed URL for the
Ilya Sherman 2013/11/19 23:43:13 nit: I'd recommend omitting "we must".
jww 2013/11/19 23:52:08 Done.
583 // access checks.
584 const GURL& current_url = web_contents()->GetLastCommittedURL();
585 invoked_from_same_origin_ =
586 current_url.GetOrigin() == source_url_.GetOrigin();
583 587
584 // Log any relevant UI metrics and security exceptions. 588 // Log any relevant UI metrics and security exceptions.
585 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN); 589 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN);
586 590
587 GetMetricLogger().LogDialogSecurityMetric( 591 GetMetricLogger().LogDialogSecurityMetric(
588 AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN); 592 AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN);
589 593
590 // Determine what field types should be included in the dialog. 594 // Determine what field types should be included in the dialog.
591 // Note that RequestingCreditCardInfo() below relies on parsed field types. 595 // Note that RequestingCreditCardInfo() below relies on parsed field types.
592 bool has_types = false; 596 bool has_types = false;
(...skipping 2907 matching lines...) Expand 10 before | Expand all | Expand 10 after
3500 view_->UpdateButtonStrip(); 3504 view_->UpdateButtonStrip();
3501 } 3505 }
3502 3506
3503 void AutofillDialogControllerImpl::FetchWalletCookie() { 3507 void AutofillDialogControllerImpl::FetchWalletCookie() {
3504 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); 3508 net::URLRequestContextGetter* request_context = profile_->GetRequestContext();
3505 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); 3509 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context));
3506 signin_helper_->StartWalletCookieValueFetch(); 3510 signin_helper_->StartWalletCookieValueFetch();
3507 } 3511 }
3508 3512
3509 } // namespace autofill 3513 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/autofill/autofill_dialog_controller_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698