| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/core/browser/autofill_download_manager.h" | 5 #include "components/autofill/core/browser/autofill_download_manager.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 driver_.SetURLRequestContext(request_context_.get()); | 75 driver_.SetURLRequestContext(request_context_.get()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void LimitCache(size_t cache_size) { | 78 void LimitCache(size_t cache_size) { |
| 79 download_manager_.set_max_form_cache_size(cache_size); | 79 download_manager_.set_max_form_cache_size(cache_size); |
| 80 } | 80 } |
| 81 | 81 |
| 82 // AutofillDownloadManager::Observer implementation. | 82 // AutofillDownloadManager::Observer implementation. |
| 83 void OnLoadedServerPredictions( | 83 void OnLoadedServerPredictions( |
| 84 const std::string& response_xml, | 84 const std::string& response_xml, |
| 85 const std::vector<FormStructure*>& queried_forms) override { | 85 const std::vector<std::string>& form_signatures) override { |
| 86 ResponseData response; | 86 ResponseData response; |
| 87 response.response = response_xml; | 87 response.response = response_xml; |
| 88 response.type_of_response = QUERY_SUCCESSFULL; | 88 response.type_of_response = QUERY_SUCCESSFULL; |
| 89 responses_.push_back(response); | 89 responses_.push_back(response); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void OnUploadedPossibleFieldTypes() override { | 92 void OnUploadedPossibleFieldTypes() override { |
| 93 ResponseData response; | 93 ResponseData response; |
| 94 response.type_of_response = UPLOAD_SUCCESSFULL; | 94 response.type_of_response = UPLOAD_SUCCESSFULL; |
| 95 responses_.push_back(response); | 95 responses_.push_back(response); |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 std::string header; | 668 std::string header; |
| 669 EXPECT_TRUE(headers.GetHeader("content-encoding", &header)); | 669 EXPECT_TRUE(headers.GetHeader("content-encoding", &header)); |
| 670 EXPECT_EQ("gzip", header); | 670 EXPECT_EQ("gzip", header); |
| 671 | 671 |
| 672 // Expect that the compression is logged. | 672 // Expect that the compression is logged. |
| 673 histogram.ExpectUniqueSample("Autofill.PayloadCompressionRatio.Upload", 92, | 673 histogram.ExpectUniqueSample("Autofill.PayloadCompressionRatio.Upload", 92, |
| 674 1); | 674 1); |
| 675 } | 675 } |
| 676 | 676 |
| 677 } // namespace autofill | 677 } // namespace autofill |
| OLD | NEW |