Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 | 36 |
| 37 // Registers profile preferences for the AutofillDialogControllerAndroid. | 37 // Registers profile preferences for the AutofillDialogControllerAndroid. |
| 38 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 38 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 39 | 39 |
| 40 virtual ~AutofillDialogControllerAndroid(); | 40 virtual ~AutofillDialogControllerAndroid(); |
| 41 | 41 |
| 42 // AutofillDialogController implementation: | 42 // AutofillDialogController implementation: |
| 43 virtual void Show() OVERRIDE; | 43 virtual void Show() OVERRIDE; |
| 44 virtual void Hide() OVERRIDE; | 44 virtual void Hide() OVERRIDE; |
| 45 virtual void TabActivated() OVERRIDE; | 45 virtual void TabActivated() OVERRIDE; |
| 46 virtual void AddAutocheckoutStep(AutocheckoutStepType step_type) OVERRIDE; | |
| 47 virtual void UpdateAutocheckoutStep( | |
| 48 AutocheckoutStepType step_type, | |
| 49 AutocheckoutStepStatus step_status) OVERRIDE; | |
| 50 virtual void OnAutocheckoutError() OVERRIDE; | |
| 51 virtual void OnAutocheckoutSuccess() OVERRIDE; | |
| 52 virtual DialogType GetDialogType() const OVERRIDE; | 46 virtual DialogType GetDialogType() const OVERRIDE; |
| 53 | 47 |
| 54 // JNI bindings for Java-side AutofillDialogDelegate: | 48 // JNI bindings for Java-side AutofillDialogDelegate: |
| 55 void DialogCancel(JNIEnv* env, jobject obj); | 49 void DialogCancel(JNIEnv* env, jobject obj); |
| 56 void DialogContinue(JNIEnv* env, | 50 void DialogContinue(JNIEnv* env, |
| 57 jobject obj, | 51 jobject obj, |
| 58 jobject full_wallet, | 52 jobject full_wallet, |
| 59 jboolean last_used_choice_is_autofill, | 53 jboolean last_used_choice_is_autofill, |
| 60 jstring last_used_account_name, | 54 jstring last_used_account_name, |
| 61 jstring last_used_billing, | 55 jstring last_used_billing, |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 80 | 74 |
| 81 // Logs metrics when the dialog is submitted. | 75 // Logs metrics when the dialog is submitted. |
| 82 void LogOnFinishSubmitMetrics(); | 76 void LogOnFinishSubmitMetrics(); |
| 83 | 77 |
| 84 // Logs metrics when the dialog is canceled. | 78 // Logs metrics when the dialog is canceled. |
| 85 void LogOnCancelMetrics(); | 79 void LogOnCancelMetrics(); |
| 86 | 80 |
| 87 bool RequestingCreditCardInfo() const; | 81 bool RequestingCreditCardInfo() const; |
| 88 bool TransmissionWillBeSecure() const; | 82 bool TransmissionWillBeSecure() const; |
| 89 | 83 |
| 90 void SetAutocheckoutState(AutocheckoutState autocheckout_state); | |
| 91 | |
| 92 // The |profile| for |contents_|. | 84 // The |profile| for |contents_|. |
| 93 Profile* const profile_; | 85 Profile* const profile_; |
| 94 | 86 |
| 95 // The WebContents where the Autocomplete/Checkout action originated. | 87 // The WebContents where the Autocomplete/Checkout action originated. |
| 96 content::WebContents* const contents_; | 88 content::WebContents* const contents_; |
| 97 | 89 |
| 98 // For logging UMA metrics. | 90 // For logging UMA metrics. |
| 99 const AutofillMetrics metric_logger_; | 91 const AutofillMetrics metric_logger_; |
| 100 base::Time dialog_shown_timestamp_; | 92 base::Time dialog_shown_timestamp_; |
| 101 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; | 93 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; |
| 102 | 94 |
| 103 // The time that Autocheckout started running. Reset on error. While this is | |
| 104 // a valid time, |AutocheckoutIsRunning()| will return true. | |
| 105 base::Time autocheckout_started_timestamp_; | |
| 106 | |
| 107 // Whether this is an Autocheckout or a requestAutocomplete dialog. | 95 // Whether this is an Autocheckout or a requestAutocomplete dialog. |
| 108 const DialogType dialog_type_; | 96 const DialogType dialog_type_; |
|
aruslan
2013/08/28 17:00:43
I think you would want to remove the dialog type a
Raman Kakilate
2013/08/28 17:12:24
Differing removing of DialogType to next CL, I hav
| |
| 109 | 97 |
| 110 FormStructure form_structure_; | 98 FormStructure form_structure_; |
| 111 | 99 |
| 112 // Whether the URL visible to the user when this dialog was requested to be | 100 // Whether the URL visible to the user when this dialog was requested to be |
| 113 // invoked is the same as |source_url_|. | 101 // invoked is the same as |source_url_|. |
| 114 bool invoked_from_same_origin_; | 102 bool invoked_from_same_origin_; |
| 115 | 103 |
| 116 // The URL of the invoking site. | 104 // The URL of the invoking site. |
| 117 GURL source_url_; | 105 GURL source_url_; |
| 118 | 106 |
| 119 // The callback via which we return the collected data and, if Online Wallet | 107 // The callback via which we return the collected data and, if Online Wallet |
| 120 // was used, the Google transaction id. | 108 // was used, the Google transaction id. |
| 121 base::Callback<void(const FormStructure*, const std::string&)> callback_; | 109 base::Callback<void(const FormStructure*, const std::string&)> callback_; |
| 122 | 110 |
| 123 // Whether |form_structure_| has asked for any details that would indicate | 111 // Whether |form_structure_| has asked for any details that would indicate |
| 124 // we should show a shipping section. | 112 // we should show a shipping section. |
| 125 bool cares_about_shipping_; | 113 bool cares_about_shipping_; |
| 126 | 114 |
| 127 base::WeakPtrFactory<AutofillDialogControllerAndroid> | 115 base::WeakPtrFactory<AutofillDialogControllerAndroid> |
| 128 weak_ptr_factory_; | 116 weak_ptr_factory_; |
| 129 | 117 |
| 130 // The current state of the Autocheckout flow. | |
| 131 AutocheckoutState autocheckout_state_; | |
| 132 | |
| 133 // Whether the latency to display to the UI was logged to UMA yet. | 118 // Whether the latency to display to the UI was logged to UMA yet. |
| 134 bool was_ui_latency_logged_; | 119 bool was_ui_latency_logged_; |
| 135 | 120 |
| 136 // The corresponding java object. | 121 // The corresponding java object. |
| 137 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 122 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 138 | 123 |
| 139 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerAndroid); | 124 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerAndroid); |
| 140 }; | 125 }; |
| 141 | 126 |
| 142 } // namespace autofill | 127 } // namespace autofill |
| 143 | 128 |
| 144 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_ANDROID _H_ | 129 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_ANDROID _H_ |
| OLD | NEW |