OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // An object to record and send user feedback to spelling service. The spelling | 5 // An object to record and send user feedback to spelling service. The spelling |
6 // service uses the feedback to improve its suggestions. | 6 // service uses the feedback to improve its suggestions. |
7 // | 7 // |
8 // Assigns uint32 hash identifiers to spelling suggestions from spelling service | 8 // Assigns uint32 hash identifiers to spelling suggestions from spelling service |
9 // and stores these suggestions. Records user's actions on these suggestions. | 9 // and stores these suggestions. Records user's actions on these suggestions. |
10 // Periodically sends batches of user feedback to the spelling service. | 10 // Periodically sends batches of user feedback to the spelling service. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void StartFeedbackCollection(); | 107 void StartFeedbackCollection(); |
108 | 108 |
109 // Sends out all previously collected data and stops collecting feedback, if | 109 // Sends out all previously collected data and stops collecting feedback, if |
110 // it was being collected. | 110 // it was being collected. |
111 void StopFeedbackCollection(); | 111 void StopFeedbackCollection(); |
112 | 112 |
113 private: | 113 private: |
114 friend class FeedbackSenderTest; | 114 friend class FeedbackSenderTest; |
115 | 115 |
116 // net::URLFetcherDelegate implementation. Takes ownership of |source|. | 116 // net::URLFetcherDelegate implementation. Takes ownership of |source|. |
117 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 117 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
118 | 118 |
119 // Requests the document markers from all of the renderers to determine which | 119 // Requests the document markers from all of the renderers to determine which |
120 // feedback can be finalized. Finalizes feedback for renderers that are gone. | 120 // feedback can be finalized. Finalizes feedback for renderers that are gone. |
121 // Called periodically when |timer_| fires. | 121 // Called periodically when |timer_| fires. |
122 void RequestDocumentMarkers(); | 122 void RequestDocumentMarkers(); |
123 | 123 |
124 // Sends out all feedback data. Resets the session-start timestamp to now. | 124 // Sends out all feedback data. Resets the session-start timestamp to now. |
125 // Restarts the timer that requests markers from the renderers. | 125 // Restarts the timer that requests markers from the renderers. |
126 void FlushFeedback(); | 126 void FlushFeedback(); |
127 | 127 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // If a sender is destroyed before it finishes, then sending feedback will be | 168 // If a sender is destroyed before it finishes, then sending feedback will be |
169 // canceled. | 169 // canceled. |
170 ScopedVector<net::URLFetcher> senders_; | 170 ScopedVector<net::URLFetcher> senders_; |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(FeedbackSender); | 172 DISALLOW_COPY_AND_ASSIGN(FeedbackSender); |
173 }; | 173 }; |
174 | 174 |
175 } // namespace spellcheck | 175 } // namespace spellcheck |
176 | 176 |
177 #endif // CHROME_BROWSER_SPELLCHECKER_FEEDBACK_SENDER_H_ | 177 #endif // CHROME_BROWSER_SPELLCHECKER_FEEDBACK_SENDER_H_ |
OLD | NEW |