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 #include "components/autofill/content/browser/wallet/wallet_client.h" | 5 #include "components/autofill/content/browser/wallet/wallet_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 base::Bind(&WalletClient::StartNextPendingRequest, | 588 base::Bind(&WalletClient::StartNextPendingRequest, |
589 weak_ptr_factory_.GetWeakPtr()));; | 589 weak_ptr_factory_.GetWeakPtr()));; |
590 | 590 |
591 std::string data; | 591 std::string data; |
592 source->GetResponseAsString(&data); | 592 source->GetResponseAsString(&data); |
593 VLOG(1) << "Response body: " << data; | 593 VLOG(1) << "Response body: " << data; |
594 | 594 |
595 scoped_ptr<base::DictionaryValue> response_dict; | 595 scoped_ptr<base::DictionaryValue> response_dict; |
596 | 596 |
597 int response_code = source->GetResponseCode(); | 597 int response_code = source->GetResponseCode(); |
| 598 delegate_->GetMetricLogger().LogWalletResponseCode(response_code); |
| 599 |
598 switch (response_code) { | 600 switch (response_code) { |
599 // HTTP_BAD_REQUEST means the arguments are invalid. No point retrying. | 601 // HTTP_BAD_REQUEST means the arguments are invalid. No point retrying. |
600 case net::HTTP_BAD_REQUEST: { | 602 case net::HTTP_BAD_REQUEST: { |
601 request_type_ = NO_PENDING_REQUEST; | 603 request_type_ = NO_PENDING_REQUEST; |
602 HandleWalletError(BAD_REQUEST); | 604 HandleWalletError(BAD_REQUEST); |
603 return; | 605 return; |
604 } | 606 } |
605 // HTTP_OK holds a valid response and HTTP_INTERNAL_SERVER_ERROR holds an | 607 // HTTP_OK holds a valid response and HTTP_INTERNAL_SERVER_ERROR holds an |
606 // error code and message for the user. | 608 // error code and message for the user. |
607 case net::HTTP_OK: | 609 case net::HTTP_OK: |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 NOTREACHED(); | 819 NOTREACHED(); |
818 return AutofillMetrics::UNKNOWN_API_CALL; | 820 return AutofillMetrics::UNKNOWN_API_CALL; |
819 } | 821 } |
820 | 822 |
821 NOTREACHED(); | 823 NOTREACHED(); |
822 return AutofillMetrics::UNKNOWN_API_CALL; | 824 return AutofillMetrics::UNKNOWN_API_CALL; |
823 } | 825 } |
824 | 826 |
825 } // namespace wallet | 827 } // namespace wallet |
826 } // namespace autofill | 828 } // namespace autofill |
OLD | NEW |