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

Side by Side Diff: components/autofill/browser/autocheckout_request_manager.cc

Issue 12457033: Implements SendAutocheckoutStatus API calls for stats tracking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaning up Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
Ilya Sherman 2013/03/26 23:50:01 License block goes here.
ahutter 2013/03/27 01:23:33 Done.
2 #include "components/autofill/browser/autocheckout_request_manager.h"
3
4 #include "components/autofill/browser/autofill_manager_delegate.h"
5 #include "content/public/browser/browser_context.h"
6
7 namespace {
8
9 const char kAutocheckoutRequestManagerKey[] =
10 "browser_context_autocheckout_request_manager";
11
12 } // namespace
13
14 namespace autofill {
15
16 AutocheckoutRequestManager::~AutocheckoutRequestManager() {}
17
18 // static
19 void AutocheckoutRequestManager::CreateFromBrowserContext(
20 content::BrowserContext* browser_context) {
21 if (FromBrowserContext(browser_context))
22 return;
23
24 browser_context->SetUserData(
25 kAutocheckoutRequestManagerKey,
26 new AutocheckoutRequestManager(browser_context->GetRequestContext()));
27 }
28
29 // static
30 AutocheckoutRequestManager* AutocheckoutRequestManager::FromBrowserContext(
31 content::BrowserContext* browser_context) {
32 return static_cast<AutocheckoutRequestManager*>(
33 browser_context->GetUserData(kAutocheckoutRequestManagerKey));
34 }
35
36 void AutocheckoutRequestManager::SendAutocheckoutStatus(
37 AutocheckoutStatus status,
38 const GURL& source_url,
39 const std::string& google_transaction_id) {
40 wallet_client_.SendAutocheckoutStatus(status,
41 source_url,
42 google_transaction_id);
43 }
44
45
46 const AutofillMetrics& AutocheckoutRequestManager::GetMetricLogger() const {
47 return metric_logger_;
48 }
49
50 DialogType AutocheckoutRequestManager::GetDialogType() const {
51 return DIALOG_TYPE_AUTOCHECKOUT;
52 }
53
54 std::string AutocheckoutRequestManager::GetRiskData() const {
55 NOTREACHED();
56 return std::string();
57 }
58
59 void AutocheckoutRequestManager::OnDidAcceptLegalDocuments() {
60 NOTREACHED();
61 }
62
63 void AutocheckoutRequestManager::OnDidAuthenticateInstrument(bool success) {
64 NOTREACHED();
65 }
66
67 void AutocheckoutRequestManager::OnDidGetFullWallet(
68 scoped_ptr<wallet::FullWallet> full_wallet) {
69 NOTREACHED();
70 }
71
72 void AutocheckoutRequestManager::OnDidGetWalletItems(
73 scoped_ptr<wallet::WalletItems> wallet_items) {
74 NOTREACHED();
75 }
76
77 void AutocheckoutRequestManager::OnDidSaveAddress(
78 const std::string& address_id,
79 const std::vector<wallet::RequiredAction>& required_actions) {
80 NOTREACHED();
81 }
82
83 void AutocheckoutRequestManager::OnDidSaveInstrument(
84 const std::string& instrument_id,
85 const std::vector<wallet::RequiredAction>& required_actions) {
86 NOTREACHED();
87 }
88
89 void AutocheckoutRequestManager::OnDidSaveInstrumentAndAddress(
90 const std::string& instrument_id,
91 const std::string& address_id,
92 const std::vector<wallet::RequiredAction>& required_actions) {
93 NOTREACHED();
94 }
95
96 void AutocheckoutRequestManager::OnDidSendAutocheckoutStatus() {
97 // This doesn't really do anything. Should I just remove it?
Ilya Sherman 2013/03/26 23:50:01 Yes, let's remove it if it's not used.
ahutter 2013/03/27 01:23:33 Done.
98 }
99
100 void AutocheckoutRequestManager::OnDidUpdateAddress(
101 const std::string& address_id,
102 const std::vector<wallet::RequiredAction>& required_actions) {
103 NOTREACHED();
104 }
105
106 void AutocheckoutRequestManager::OnDidUpdateInstrument(
107 const std::string& instrument_id,
108 const std::vector<wallet::RequiredAction>& required_actions) {
109 NOTREACHED();
110 }
111
112 void AutocheckoutRequestManager::OnWalletError(
113 wallet::WalletClient::ErrorType error_type) {
114 // I think this is already logged somewhere...
Ilya Sherman 2013/03/26 23:50:01 Indeed, logged by the MetricLogger. Please update
ahutter 2013/03/27 01:23:33 Done.
115 }
116
117 void AutocheckoutRequestManager::OnMalformedResponse() {
118 // Nothing to be done.
119 }
120
121 void AutocheckoutRequestManager::OnNetworkError(int response_code) {
122 // I think this is already logged somewhere...
Ilya Sherman 2013/03/26 23:50:01 Ditto.
ahutter 2013/03/27 01:23:33 Done.
123 }
124
125 AutocheckoutRequestManager::AutocheckoutRequestManager(
126 net::URLRequestContextGetter* request_context_getter)
127 : wallet_client_(request_context_getter, this) {
128 }
129
130 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698