Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
|
Lei Zhang
2010/10/19 01:37:10
I think you can remove vector here.
I wish cpp li
| |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/scoped_vector.h" | 13 #include "base/scoped_vector.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "chrome/browser/autofill/autofill_profile.h" | 15 #include "chrome/browser/autofill/autofill_profile.h" |
| 16 #include "chrome/browser/autofill/field_types.h" | 16 #include "chrome/browser/autofill/field_types.h" |
| 17 #include "chrome/browser/autofill/form_structure.h" | 17 #include "chrome/browser/autofill/form_structure.h" |
| 18 #include "chrome/common/net/url_fetcher.h" | 18 #include "chrome/common/net/url_fetcher.h" |
| 19 | 19 |
| 20 class Profile; | 20 class Profile; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 double GetNegativeUploadRate() const; | 85 double GetNegativeUploadRate() const; |
| 86 // These functions called very rarely outside of theunit-tests. With current | 86 // These functions called very rarely outside of theunit-tests. With current |
| 87 // percentages, they would be called once per 100 auto-fillable forms filled | 87 // percentages, they would be called once per 100 auto-fillable forms filled |
| 88 // and submitted by user. The order of magnitude would remain similar in the | 88 // and submitted by user. The order of magnitude would remain similar in the |
| 89 // future. | 89 // future. |
| 90 void SetPositiveUploadRate(double rate); | 90 void SetPositiveUploadRate(double rate); |
| 91 void SetNegativeUploadRate(double rate); | 91 void SetNegativeUploadRate(double rate); |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 friend class AutoFillDownloadTestHelper; // unit-test. | 94 friend class AutoFillDownloadTestHelper; // unit-test. |
| 95 struct FormRequestData { | 95 |
| 96 std::vector<std::string> form_signatures; | 96 struct FormRequestData; |
| 97 AutoFillRequestType request_type; | |
| 98 }; | |
| 99 | 97 |
| 100 // Initiates request to AutoFill servers to download/upload heuristics. | 98 // Initiates request to AutoFill servers to download/upload heuristics. |
| 101 // |form_xml| - form structure XML to upload/download. | 99 // |form_xml| - form structure XML to upload/download. |
| 102 // |request_data| - form signature hash(es) and indicator if it was a query. | 100 // |request_data| - form signature hash(es) and indicator if it was a query. |
| 103 // |request_data.query| - if true the data is queried and observer notified | 101 // |request_data.query| - if true the data is queried and observer notified |
| 104 // with new data, if available. If false heuristic data is uploaded to our | 102 // with new data, if available. If false heuristic data is uploaded to our |
| 105 // servers. | 103 // servers. |
| 106 bool StartRequest(const std::string& form_xml, | 104 bool StartRequest(const std::string& form_xml, |
| 107 const FormRequestData& request_data); | 105 const FormRequestData& request_data); |
| 108 | 106 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 134 double positive_upload_rate_; | 132 double positive_upload_rate_; |
| 135 double negative_upload_rate_; | 133 double negative_upload_rate_; |
| 136 | 134 |
| 137 // Needed for unit-test. | 135 // Needed for unit-test. |
| 138 int fetcher_id_for_unittest_; | 136 int fetcher_id_for_unittest_; |
| 139 bool is_testing_; | 137 bool is_testing_; |
| 140 }; | 138 }; |
| 141 | 139 |
| 142 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ | 140 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ |
| 143 | 141 |
| OLD | NEW |