OLD | NEW |
---|---|
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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
581 const base::Callback<void(const FormStructure*)>& callback) { | 581 const base::Callback<void(const FormStructure*)>& callback) { |
582 return AutofillDialogControllerImpl::Create(contents, | 582 return AutofillDialogControllerImpl::Create(contents, |
583 form_structure, | 583 form_structure, |
584 source_url, | 584 source_url, |
585 callback); | 585 callback); |
586 } | 586 } |
587 | 587 |
588 void AutofillDialogControllerImpl::Show() { | 588 void AutofillDialogControllerImpl::Show() { |
589 dialog_shown_timestamp_ = base::Time::Now(); | 589 dialog_shown_timestamp_ = base::Time::Now(); |
590 | 590 |
591 content::NavigationEntry* entry = | 591 // Autocomplete is shown in response to a message from the renderer. As such, |
592 web_contents()->GetController().GetActiveEntry(); | 592 // it can only be made in the context of the current document and we must use |
593 const GURL& active_url = entry ? entry->GetURL() : web_contents()->GetURL(); | 593 // last committed URL for access checks. |
594 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.
| |
594 invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); | 595 invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); |
595 | 596 |
596 // Log any relevant UI metrics and security exceptions. | 597 // Log any relevant UI metrics and security exceptions. |
597 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN); | 598 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN); |
598 | 599 |
599 GetMetricLogger().LogDialogSecurityMetric( | 600 GetMetricLogger().LogDialogSecurityMetric( |
600 AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN); | 601 AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN); |
601 | 602 |
602 // Determine what field types should be included in the dialog. | 603 // Determine what field types should be included in the dialog. |
603 // Note that RequestingCreditCardInfo() below relies on parsed field types. | 604 // Note that RequestingCreditCardInfo() below relies on parsed field types. |
(...skipping 2979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3583 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 3584 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
3584 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 3585 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
3585 signin_helper_->StartWalletCookieValueFetch(); | 3586 signin_helper_->StartWalletCookieValueFetch(); |
3586 | 3587 |
3587 username_fetcher_.reset( | 3588 username_fetcher_.reset( |
3588 new wallet::WalletSigninHelper(this, request_context)); | 3589 new wallet::WalletSigninHelper(this, request_context)); |
3589 username_fetcher_->StartUserNameFetch(); | 3590 username_fetcher_->StartUserNameFetch(); |
3590 } | 3591 } |
3591 | 3592 |
3592 } // namespace autofill | 3593 } // namespace autofill |
OLD | NEW |