| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DOWNLOAD_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DOWNLOAD_MANAGER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DOWNLOAD_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DOWNLOAD_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // Handles getting and updating Autofill heuristics. | 32 // Handles getting and updating Autofill heuristics. |
| 33 class AutofillDownloadManager : public net::URLFetcherDelegate { | 33 class AutofillDownloadManager : public net::URLFetcherDelegate { |
| 34 public: | 34 public: |
| 35 enum RequestType { REQUEST_QUERY, REQUEST_UPLOAD, }; | 35 enum RequestType { REQUEST_QUERY, REQUEST_UPLOAD, }; |
| 36 | 36 |
| 37 // An interface used to notify clients of AutofillDownloadManager. | 37 // An interface used to notify clients of AutofillDownloadManager. |
| 38 class Observer { | 38 class Observer { |
| 39 public: | 39 public: |
| 40 // Called when field type predictions are successfully received from the | 40 // Called when field type predictions are successfully received from the |
| 41 // server. |response_xml| contains the server response for the | 41 // server. |response_xml| contains the server response for the forms |
| 42 // |queried_forms|. | 42 // represented by |form_signatures|. |
| 43 virtual void OnLoadedServerPredictions( | 43 virtual void OnLoadedServerPredictions( |
| 44 const std::string& response_xml, | 44 const std::string& response_xml, |
| 45 const std::vector<FormStructure*>& queried_forms) = 0; | 45 const std::vector<std::string>& form_signatures) = 0; |
| 46 | 46 |
| 47 // These notifications are used to help with testing. | 47 // These notifications are used to help with testing. |
| 48 // Called when heuristic either successfully considered for upload and | 48 // Called when heuristic either successfully considered for upload and |
| 49 // not send or uploaded. | 49 // not send or uploaded. |
| 50 virtual void OnUploadedPossibleFieldTypes() {} | 50 virtual void OnUploadedPossibleFieldTypes() {} |
| 51 // Called when there was an error during the request. | 51 // Called when there was an error during the request. |
| 52 // |form_signature| - the signature of the requesting form. | 52 // |form_signature| - the signature of the requesting form. |
| 53 // |request_type| - type of request that failed. | 53 // |request_type| - type of request that failed. |
| 54 // |http_error| - HTTP error code. | 54 // |http_error| - HTTP error code. |
| 55 virtual void OnServerRequestError(const std::string& form_signature, | 55 virtual void OnServerRequestError(const std::string& form_signature, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 double positive_upload_rate_; | 170 double positive_upload_rate_; |
| 171 double negative_upload_rate_; | 171 double negative_upload_rate_; |
| 172 | 172 |
| 173 // Needed for unit-test. | 173 // Needed for unit-test. |
| 174 int fetcher_id_for_unittest_; | 174 int fetcher_id_for_unittest_; |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 } // namespace autofill | 177 } // namespace autofill |
| 178 | 178 |
| 179 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DOWNLOAD_MANAGER_H_ | 179 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |