| 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 | 632 |
| 633 // static | 633 // static |
| 634 void AutofillDialogController::RegisterProfilePrefs( | 634 void AutofillDialogController::RegisterProfilePrefs( |
| 635 user_prefs::PrefRegistrySyncable* registry) { | 635 user_prefs::PrefRegistrySyncable* registry) { |
| 636 AutofillDialogControllerImpl::RegisterProfilePrefs(registry); | 636 AutofillDialogControllerImpl::RegisterProfilePrefs(registry); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void AutofillDialogControllerImpl::Show() { | 639 void AutofillDialogControllerImpl::Show() { |
| 640 dialog_shown_timestamp_ = base::Time::Now(); | 640 dialog_shown_timestamp_ = base::Time::Now(); |
| 641 | 641 |
| 642 content::NavigationEntry* entry = | 642 // Autocomplete is shown in response to a message from the renderer. As |
| 643 web_contents()->GetController().GetActiveEntry(); | 643 // such, it can only be made in the context of the current document and we |
| 644 const GURL& active_url = entry ? entry->GetURL() : web_contents()->GetURL(); | 644 // must use last committed URL for access checks. |
| 645 const GURL& active_url = web_contents()->GetLastCommittedURL(); |
| 645 invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); | 646 invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); |
| 646 | 647 |
| 647 // Log any relevant UI metrics and security exceptions. | 648 // Log any relevant UI metrics and security exceptions. |
| 648 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN); | 649 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN); |
| 649 | 650 |
| 650 GetMetricLogger().LogDialogSecurityMetric( | 651 GetMetricLogger().LogDialogSecurityMetric( |
| 651 AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN); | 652 AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN); |
| 652 | 653 |
| 653 // Determine what field types should be included in the dialog. | 654 // Determine what field types should be included in the dialog. |
| 654 // Note that RequestingCreditCardInfo() below relies on parsed field types. | 655 // Note that RequestingCreditCardInfo() below relies on parsed field types. |
| (...skipping 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3500 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 3501 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
| 3501 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 3502 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
| 3502 signin_helper_->StartWalletCookieValueFetch(); | 3503 signin_helper_->StartWalletCookieValueFetch(); |
| 3503 | 3504 |
| 3504 username_fetcher_.reset( | 3505 username_fetcher_.reset( |
| 3505 new wallet::WalletSigninHelper(this, request_context)); | 3506 new wallet::WalletSigninHelper(this, request_context)); |
| 3506 username_fetcher_->StartUserNameFetch(); | 3507 username_fetcher_->StartUserNameFetch(); |
| 3507 } | 3508 } |
| 3508 | 3509 |
| 3509 } // namespace autofill | 3510 } // namespace autofill |
| OLD | NEW |