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_WALLET_WALLET_CLIENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" // For base::Closure. | 12 #include "base/callback.h" // For base::Closure. |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "components/autofill/content/browser/autocheckout_statistic.h" | |
17 #include "components/autofill/content/browser/wallet/full_wallet.h" | 16 #include "components/autofill/content/browser/wallet/full_wallet.h" |
18 #include "components/autofill/content/browser/wallet/wallet_items.h" | 17 #include "components/autofill/content/browser/wallet/wallet_items.h" |
19 #include "components/autofill/core/browser/autofill_manager_delegate.h" | 18 #include "components/autofill/core/browser/autofill_manager_delegate.h" |
20 #include "components/autofill/core/browser/autofill_metrics.h" | 19 #include "components/autofill/core/browser/autofill_metrics.h" |
21 #include "components/autofill/core/common/autocheckout_status.h" | 20 #include "components/autofill/core/common/autocheckout_status.h" |
22 #include "net/url_request/url_fetcher_delegate.h" | 21 #include "net/url_request/url_fetcher_delegate.h" |
23 #include "testing/gtest/include/gtest/gtest_prod.h" | 22 #include "testing/gtest/include/gtest/gtest_prod.h" |
24 #include "url/gurl.h" | 23 #include "url/gurl.h" |
25 | 24 |
26 namespace net { | 25 namespace net { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // Saves the data in |instrument| and/or |address| to Wallet. |instrument| | 161 // Saves the data in |instrument| and/or |address| to Wallet. |instrument| |
163 // does not have to be complete if its being used to update an existing | 162 // does not have to be complete if its being used to update an existing |
164 // instrument, like in the case of expiration date or address only updates. | 163 // instrument, like in the case of expiration date or address only updates. |
165 virtual void SaveToWallet(scoped_ptr<Instrument> instrument, | 164 virtual void SaveToWallet(scoped_ptr<Instrument> instrument, |
166 scoped_ptr<Address> address, | 165 scoped_ptr<Address> address, |
167 const GURL& source_url); | 166 const GURL& source_url); |
168 | 167 |
169 // SendAutocheckoutStatus is used for tracking the success of Autocheckout | 168 // SendAutocheckoutStatus is used for tracking the success of Autocheckout |
170 // flows. |status| is the result of the flow, |source_url| is the domain | 169 // flows. |status| is the result of the flow, |source_url| is the domain |
171 // where the purchase occured, and |google_transaction_id| is the same as the | 170 // where the purchase occured, and |google_transaction_id| is the same as the |
172 // one provided by GetWalletItems. |latency_statistics| contain statistics | 171 // one provided by GetWalletItems. |
173 // required to measure Autocheckout process. | |
174 virtual void SendAutocheckoutStatus( | 172 virtual void SendAutocheckoutStatus( |
175 autofill::AutocheckoutStatus status, | 173 autofill::AutocheckoutStatus status, |
176 const GURL& source_url, | 174 const GURL& source_url, |
177 const std::vector<AutocheckoutStatistic>& latency_statistics, | |
178 const std::string& google_transaction_id); | 175 const std::string& google_transaction_id); |
179 | 176 |
180 bool HasRequestInProgress() const; | 177 bool HasRequestInProgress() const; |
181 | 178 |
182 // Cancels and clears the current |request_| and |pending_requests_| (if any). | 179 // Cancels and clears the current |request_| and |pending_requests_| (if any). |
183 void CancelRequests(); | 180 void CancelRequests(); |
184 | 181 |
185 private: | 182 private: |
186 FRIEND_TEST_ALL_PREFIXES(WalletClientTest, PendingRequest); | 183 FRIEND_TEST_ALL_PREFIXES(WalletClientTest, PendingRequest); |
187 FRIEND_TEST_ALL_PREFIXES(WalletClientTest, CancelRequests); | 184 FRIEND_TEST_ALL_PREFIXES(WalletClientTest, CancelRequests); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // When the current request started. Used to track client side latency. | 248 // When the current request started. Used to track client side latency. |
252 base::Time request_started_timestamp_; | 249 base::Time request_started_timestamp_; |
253 | 250 |
254 DISALLOW_COPY_AND_ASSIGN(WalletClient); | 251 DISALLOW_COPY_AND_ASSIGN(WalletClient); |
255 }; | 252 }; |
256 | 253 |
257 } // namespace wallet | 254 } // namespace wallet |
258 } // namespace autofill | 255 } // namespace autofill |
259 | 256 |
260 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ | 257 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_CLIENT_H_ |
OLD | NEW |