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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 show in response to a message from the renderer. As such, |
Charlie Reis
2013/11/19 23:10:56
nit: shown
jww
2013/11/19 23:32:02
Done.
| |
580 web_contents()->GetController().GetActiveEntry(); | 580 // it can only be made in the context of the current document and we must use |
581 const GURL& active_url = entry ? entry->GetURL() : web_contents()->GetURL(); | 581 // the last committed URL for access checks. |
Ilya Sherman
2013/11/19 22:56:24
Hmm, I don't really see the value of this comment.
Charlie Reis
2013/11/19 23:10:56
It's apparently non-obvious, because there's a bug
Ilya Sherman
2013/11/19 23:24:37
Fair point, though I think that has more to do wit
jww
2013/11/19 23:32:02
I've uploaded a new comment. @isherman, can you le
| |
582 invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); | 582 const GURL& current_url = web_contents()->GetLastCommittedURL(); |
583 invoked_from_same_origin_ = | |
584 current_url.GetOrigin() == source_url_.GetOrigin(); | |
583 | 585 |
584 // Log any relevant UI metrics and security exceptions. | 586 // Log any relevant UI metrics and security exceptions. |
585 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN); | 587 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN); |
586 | 588 |
587 GetMetricLogger().LogDialogSecurityMetric( | 589 GetMetricLogger().LogDialogSecurityMetric( |
588 AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN); | 590 AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN); |
589 | 591 |
590 // Determine what field types should be included in the dialog. | 592 // Determine what field types should be included in the dialog. |
591 // Note that RequestingCreditCardInfo() below relies on parsed field types. | 593 // Note that RequestingCreditCardInfo() below relies on parsed field types. |
592 bool has_types = false; | 594 bool has_types = false; |
(...skipping 2907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3500 view_->UpdateButtonStrip(); | 3502 view_->UpdateButtonStrip(); |
3501 } | 3503 } |
3502 | 3504 |
3503 void AutofillDialogControllerImpl::FetchWalletCookie() { | 3505 void AutofillDialogControllerImpl::FetchWalletCookie() { |
3504 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 3506 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
3505 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 3507 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
3506 signin_helper_->StartWalletCookieValueFetch(); | 3508 signin_helper_->StartWalletCookieValueFetch(); |
3507 } | 3509 } |
3508 | 3510 |
3509 } // namespace autofill | 3511 } // namespace autofill |
OLD | NEW |