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

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

Issue 23537014: rAc: Get rid of dialog type in rAc, there is only one type left now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 a7406ad0ff8f434b1e73a0779cdfef9cadd1564d..ff1732d940c525ce3717c012d84e62059f9564ca 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -489,8 +489,7 @@ AutofillDialogControllerImpl::~AutofillDialogControllerImpl() {
if (popup_controller_)
popup_controller_->Hide();
- GetMetricLogger().LogDialogInitialUserState(
- GetDialogType(), initial_user_state_);
+ GetMetricLogger().LogDialogInitialUserState(initial_user_state_);
}
// static
@@ -499,7 +498,6 @@ base::WeakPtr<AutofillDialogControllerImpl>
content::WebContents* contents,
const FormData& form_structure,
const GURL& source_url,
- const DialogType dialog_type,
const base::Callback<void(const FormStructure*,
const std::string&)>& callback) {
// AutofillDialogControllerImpl owns itself.
@@ -507,7 +505,6 @@ base::WeakPtr<AutofillDialogControllerImpl>
new AutofillDialogControllerImpl(contents,
form_structure,
source_url,
- dialog_type,
callback);
return autofill_dialog_controller->weak_ptr_factory_.GetWeakPtr();
}
@@ -537,13 +534,11 @@ base::WeakPtr<AutofillDialogController> AutofillDialogController::Create(
content::WebContents* contents,
const FormData& form_structure,
const GURL& source_url,
- const DialogType dialog_type,
const base::Callback<void(const FormStructure*,
const std::string&)>& callback) {
return AutofillDialogControllerImpl::Create(contents,
form_structure,
source_url,
- dialog_type,
callback);
}
@@ -562,21 +557,18 @@ void AutofillDialogControllerImpl::Show() {
invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin();
// Log any relevant UI metrics and security exceptions.
- GetMetricLogger().LogDialogUiEvent(
- GetDialogType(), AutofillMetrics::DIALOG_UI_SHOWN);
+ GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_SHOWN);
GetMetricLogger().LogDialogSecurityMetric(
- GetDialogType(), AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN);
+ AutofillMetrics::SECURITY_METRIC_DIALOG_SHOWN);
if (RequestingCreditCardInfo() && !TransmissionWillBeSecure()) {
GetMetricLogger().LogDialogSecurityMetric(
- GetDialogType(),
AutofillMetrics::SECURITY_METRIC_CREDIT_CARD_OVER_HTTP);
}
if (!invoked_from_same_origin_) {
GetMetricLogger().LogDialogSecurityMetric(
- GetDialogType(),
AutofillMetrics::SECURITY_METRIC_CROSS_ORIGIN_FRAME);
}
@@ -760,8 +752,7 @@ bool AutofillDialogControllerImpl::IsDialogButtonEnabled(
DialogOverlayState AutofillDialogControllerImpl::GetDialogOverlay() const {
bool show_wallet_interstitial = IsPayingWithWallet() && is_submitting_ &&
- !IsSubmitPausedOn(wallet::VERIFY_CVV) &&
- GetDialogType() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE;
+ !IsSubmitPausedOn(wallet::VERIFY_CVV);
if (!show_wallet_interstitial)
return DialogOverlayState();
@@ -1417,7 +1408,7 @@ void AutofillDialogControllerImpl::EditClickedForSection(
UpdateSection(section);
GetMetricLogger().LogDialogUiEvent(
- GetDialogType(), common::DialogSectionToUiEditEvent(section));
+ common::DialogSectionToUiEditEvent(section));
}
gfx::Image AutofillDialogControllerImpl::IconForField(
@@ -1820,7 +1811,7 @@ void AutofillDialogControllerImpl::SignInLinkClicked() {
view_->UpdateAccountChooser();
GetMetricLogger().LogDialogUiEvent(
- GetDialogType(), AutofillMetrics::DIALOG_UI_SIGNIN_SHOWN);
+ AutofillMetrics::DIALOG_UI_SIGNIN_SHOWN);
} else {
HideSignIn();
}
@@ -1899,8 +1890,7 @@ content::WebContents* AutofillDialogControllerImpl::GetWebContents() {
void AutofillDialogControllerImpl::OnPopupShown(
content::RenderWidgetHost::KeyPressEventCallback* callback) {
- GetMetricLogger().LogDialogPopupEvent(
- GetDialogType(), AutofillMetrics::DIALOG_POPUP_SHOWN);
+ GetMetricLogger().LogDialogPopupEvent(AutofillMetrics::DIALOG_POPUP_SHOWN);
}
void AutofillDialogControllerImpl::OnPopupHidden(
@@ -1937,7 +1927,7 @@ void AutofillDialogControllerImpl::DidAcceptSuggestion(const string16& value,
}
GetMetricLogger().LogDialogPopupEvent(
- GetDialogType(), AutofillMetrics::DIALOG_POPUP_FORM_FILLED);
+ AutofillMetrics::DIALOG_POPUP_FORM_FILLED);
// TODO(estade): not sure why it's necessary to do this explicitly.
HidePopup();
@@ -2015,10 +2005,6 @@ const AutofillMetrics& AutofillDialogControllerImpl::GetMetricLogger() const {
return metric_logger_;
}
-DialogType AutofillDialogControllerImpl::GetDialogType() const {
- return dialog_type_;
-}
-
std::string AutofillDialogControllerImpl::GetRiskData() const {
DCHECK(!risk_data_.empty());
return risk_data_;
@@ -2225,19 +2211,16 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl(
content::WebContents* contents,
const FormData& form_structure,
const GURL& source_url,
- const DialogType dialog_type,
const base::Callback<void(const FormStructure*,
const std::string&)>& callback)
: WebContentsObserver(contents),
profile_(Profile::FromBrowserContext(contents->GetBrowserContext())),
initial_user_state_(AutofillMetrics::DIALOG_USER_STATE_UNKNOWN),
- dialog_type_(dialog_type),
form_structure_(form_structure),
invoked_from_same_origin_(true),
source_url_(source_url),
callback_(callback),
- account_chooser_model_(this, profile_->GetPrefs(), metric_logger_,
- dialog_type),
+ account_chooser_model_(this, profile_->GetPrefs(), metric_logger_),
wallet_client_(profile_->GetRequestContext(), this),
suggested_email_(this),
suggested_cc_(this),
@@ -2298,7 +2281,7 @@ void AutofillDialogControllerImpl::LoadRiskFingerprintData() {
risk::GetFingerprint(
obfuscated_gaia_id, window_bounds, *web_contents(),
chrome::VersionInfo().Version(), charset, accept_languages, install_time,
- dialog_type_, g_browser_process->GetApplicationLocale(),
+ g_browser_process->GetApplicationLocale(),
base::Bind(&AutofillDialogControllerImpl::OnDidLoadRiskFingerprintData,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -3043,20 +3026,15 @@ void AutofillDialogControllerImpl::FinishSubmit() {
if (IsPayingWithWallet() &&
!profile_->GetPrefs()->GetBoolean(
::prefs::kAutofillDialogHasPaidWithWallet)) {
- if (GetDialogType() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE) {
- // To get past this point, the view must call back OverlayButtonPressed.
+ // To get past this point, the view must call back OverlayButtonPressed.
#if defined(TOOLKIT_VIEWS)
- ScopedViewUpdates updates(view_.get());
- view_->UpdateButtonStrip();
+ ScopedViewUpdates updates(view_.get());
+ view_->UpdateButtonStrip();
#else
- // TODO(estade): implement overlays on other platforms.
- OverlayButtonPressed();
+ // TODO(estade): implement overlays on other platforms.
+ OverlayButtonPressed();
#endif
- return;
- } else {
- profile_->GetPrefs()->SetBoolean(
- ::prefs::kAutofillDialogHasPaidWithWallet, true);
- }
+ return;
}
FillOutputForSection(SECTION_EMAIL);
@@ -3112,8 +3090,7 @@ void AutofillDialogControllerImpl::FinishSubmit() {
data_was_passed_back_ = true;
// This might delete us.
- if (GetDialogType() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE)
- Hide();
+ Hide();
}
void AutofillDialogControllerImpl::PersistAutofillChoice(
@@ -3183,11 +3160,9 @@ size_t AutofillDialogControllerImpl::GetSelectedVariantForModel(
void AutofillDialogControllerImpl::LogOnFinishSubmitMetrics() {
GetMetricLogger().LogDialogUiDuration(
base::Time::Now() - dialog_shown_timestamp_,
- GetDialogType(),
AutofillMetrics::DIALOG_ACCEPTED);
- GetMetricLogger().LogDialogUiEvent(
- GetDialogType(), AutofillMetrics::DIALOG_UI_ACCEPTED);
+ GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_ACCEPTED);
AutofillMetrics::DialogDismissalState dismissal_state;
if (!IsManuallyEditingAnySection())
@@ -3199,12 +3174,11 @@ void AutofillDialogControllerImpl::LogOnFinishSubmitMetrics() {
else
dismissal_state = AutofillMetrics::DIALOG_ACCEPTED_NO_SAVE;
- GetMetricLogger().LogDialogDismissalState(GetDialogType(), dismissal_state);
+ GetMetricLogger().LogDialogDismissalState(dismissal_state);
}
void AutofillDialogControllerImpl::LogOnCancelMetrics() {
- GetMetricLogger().LogDialogUiEvent(
- GetDialogType(), AutofillMetrics::DIALOG_UI_CANCELED);
+ GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED);
AutofillMetrics::DialogDismissalState dismissal_state;
if (!signin_registrar_.IsEmpty())
@@ -3216,11 +3190,10 @@ void AutofillDialogControllerImpl::LogOnCancelMetrics() {
else
dismissal_state = AutofillMetrics::DIALOG_CANCELED_WITH_INVALID_FIELDS;
- GetMetricLogger().LogDialogDismissalState(GetDialogType(), dismissal_state);
+ GetMetricLogger().LogDialogDismissalState(dismissal_state);
GetMetricLogger().LogDialogUiDuration(
base::Time::Now() - dialog_shown_timestamp_,
- GetDialogType(),
AutofillMetrics::DIALOG_CANCELED);
}
@@ -3241,7 +3214,7 @@ void AutofillDialogControllerImpl::LogSuggestionItemSelectedMetric(
return;
}
- GetMetricLogger().LogDialogUiEvent(GetDialogType(), dialog_ui_event);
+ GetMetricLogger().LogDialogUiEvent(dialog_ui_event);
}
void AutofillDialogControllerImpl::LogDialogLatencyToShow() {
@@ -3249,7 +3222,6 @@ void AutofillDialogControllerImpl::LogDialogLatencyToShow() {
return;
GetMetricLogger().LogDialogLatencyToShow(
- GetDialogType(),
base::Time::Now() - dialog_shown_timestamp_);
was_ui_latency_logged_ = true;
}

Powered by Google App Engine
This is Rietveld 408576698