| 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 COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOCHECKOUT_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOCHECKOUT_MANAGER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOCHECKOUT_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOCHECKOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "base/time/time.h" | |
| 16 #include "components/autofill/content/browser/autocheckout_page_meta_data.h" | 15 #include "components/autofill/content/browser/autocheckout_page_meta_data.h" |
| 17 #include "components/autofill/content/browser/autocheckout_statistic.h" | |
| 18 #include "components/autofill/core/browser/autocheckout_bubble_state.h" | 16 #include "components/autofill/core/browser/autocheckout_bubble_state.h" |
| 19 #include "components/autofill/core/common/autocheckout_status.h" | 17 #include "components/autofill/core/common/autocheckout_status.h" |
| 20 | 18 |
| 21 class GURL; | 19 class GURL; |
| 22 | 20 |
| 23 namespace gfx { | 21 namespace gfx { |
| 24 class RectF; | 22 class RectF; |
| 25 } | 23 } |
| 26 | 24 |
| 27 namespace net { | 25 namespace net { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Sends |status| to Online Wallet using AutocheckoutRequestManager. | 119 // Sends |status| to Online Wallet using AutocheckoutRequestManager. |
| 122 void SendAutocheckoutStatus(AutocheckoutStatus status); | 120 void SendAutocheckoutStatus(AutocheckoutStatus status); |
| 123 | 121 |
| 124 // Sets value of form field data |field_to_fill| based on the Autofill | 122 // Sets value of form field data |field_to_fill| based on the Autofill |
| 125 // field type specified by |field|. | 123 // field type specified by |field|. |
| 126 void SetValue(const AutofillField& field, FormFieldData* field_to_fill); | 124 void SetValue(const AutofillField& field, FormFieldData* field_to_fill); |
| 127 | 125 |
| 128 // Sets the progress of all steps for the given page to the provided value. | 126 // Sets the progress of all steps for the given page to the provided value. |
| 129 void SetStepProgressForPage(int page_number, AutocheckoutStepStatus status); | 127 void SetStepProgressForPage(int page_number, AutocheckoutStepStatus status); |
| 130 | 128 |
| 131 // Account time spent between now and |last_step_completion_timestamp_| | |
| 132 // towards |page_number|. | |
| 133 void RecordTimeTaken(int page_number); | |
| 134 | |
| 135 // Terminate the Autocheckout flow and send Autocheckout status to Wallet | 129 // Terminate the Autocheckout flow and send Autocheckout status to Wallet |
| 136 // server. | 130 // server. |
| 137 void EndAutocheckout(AutocheckoutStatus status); | 131 void EndAutocheckout(AutocheckoutStatus status); |
| 138 | 132 |
| 139 AutofillManager* autofill_manager_; // WEAK; owns us | 133 AutofillManager* autofill_manager_; // WEAK; owns us |
| 140 | 134 |
| 141 // Credit card verification code. | 135 // Credit card verification code. |
| 142 base::string16 cvv_; | 136 base::string16 cvv_; |
| 143 | 137 |
| 144 // Profile built using the data supplied by requestAutocomplete dialog. | 138 // Profile built using the data supplied by requestAutocomplete dialog. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 164 // Whether or not the user is in an Autocheckout flow. | 158 // Whether or not the user is in an Autocheckout flow. |
| 165 bool in_autocheckout_flow_; | 159 bool in_autocheckout_flow_; |
| 166 | 160 |
| 167 // Whether or not the currently visible dialog, if there is one, should be | 161 // Whether or not the currently visible dialog, if there is one, should be |
| 168 // preserved. | 162 // preserved. |
| 169 bool should_preserve_dialog_; | 163 bool should_preserve_dialog_; |
| 170 | 164 |
| 171 // AutocheckoutStepTypes for the various pages of the flow. | 165 // AutocheckoutStepTypes for the various pages of the flow. |
| 172 std::map<int, std::vector<AutocheckoutStepType> > page_types_; | 166 std::map<int, std::vector<AutocheckoutStepType> > page_types_; |
| 173 | 167 |
| 174 // Timestamp of last step's completion. | |
| 175 base::TimeTicks last_step_completion_timestamp_; | |
| 176 | |
| 177 // Per page latency statistics. | |
| 178 std::vector<AutocheckoutStatistic> latency_statistics_; | |
| 179 | |
| 180 std::string google_transaction_id_; | 168 std::string google_transaction_id_; |
| 181 | 169 |
| 182 base::WeakPtrFactory<AutocheckoutManager> weak_ptr_factory_; | 170 base::WeakPtrFactory<AutocheckoutManager> weak_ptr_factory_; |
| 183 | 171 |
| 184 base::ThreadChecker thread_checker_; | 172 base::ThreadChecker thread_checker_; |
| 185 | 173 |
| 186 DISALLOW_COPY_AND_ASSIGN(AutocheckoutManager); | 174 DISALLOW_COPY_AND_ASSIGN(AutocheckoutManager); |
| 187 }; | 175 }; |
| 188 | 176 |
| 189 } // namespace autofill | 177 } // namespace autofill |
| 190 | 178 |
| 191 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOCHECKOUT_MANAGER_H_ | 179 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOCHECKOUT_MANAGER_H_ |
| OLD | NEW |