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 | |
600 switch (response_code) { | 598 switch (response_code) { |
601 // HTTP_BAD_REQUEST means the arguments are invalid. No point retrying. | 599 // HTTP_BAD_REQUEST means the arguments are invalid. No point retrying. |
602 case net::HTTP_BAD_REQUEST: { | 600 case net::HTTP_BAD_REQUEST: { |
603 request_type_ = NO_PENDING_REQUEST; | 601 request_type_ = NO_PENDING_REQUEST; |
604 HandleWalletError(BAD_REQUEST); | 602 HandleWalletError(BAD_REQUEST); |
605 return; | 603 return; |
606 } | 604 } |
607 // HTTP_OK holds a valid response and HTTP_INTERNAL_SERVER_ERROR holds an | 605 // HTTP_OK holds a valid response and HTTP_INTERNAL_SERVER_ERROR holds an |
608 // error code and message for the user. | 606 // error code and message for the user. |
609 case net::HTTP_OK: | 607 case net::HTTP_OK: |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 NOTREACHED(); | 817 NOTREACHED(); |
820 return AutofillMetrics::UNKNOWN_API_CALL; | 818 return AutofillMetrics::UNKNOWN_API_CALL; |
821 } | 819 } |
822 | 820 |
823 NOTREACHED(); | 821 NOTREACHED(); |
824 return AutofillMetrics::UNKNOWN_API_CALL; | 822 return AutofillMetrics::UNKNOWN_API_CALL; |
825 } | 823 } |
826 | 824 |
827 } // namespace wallet | 825 } // namespace wallet |
828 } // namespace autofill | 826 } // namespace autofill |
OLD | NEW |