| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SPELLCHECKER_SPELLING_SERVICE_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLING_SERVICE_CLIENT_H_ |
| 6 #define CHROME_BROWSER_SPELLCHECKER_SPELLING_SERVICE_CLIENT_H_ | 6 #define CHROME_BROWSER_SPELLCHECKER_SPELLING_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // * SPELLCHECK: Spellchecking text (used by Google Docs). | 61 // * SPELLCHECK: Spellchecking text (used by Google Docs). |
| 62 // This type is used for choosing a backend when sending a JSON-RPC request to | 62 // This type is used for choosing a backend when sending a JSON-RPC request to |
| 63 // the service. | 63 // the service. |
| 64 enum ServiceType { | 64 enum ServiceType { |
| 65 SUGGEST = 1, | 65 SUGGEST = 1, |
| 66 SPELLCHECK = 2, | 66 SPELLCHECK = 2, |
| 67 }; | 67 }; |
| 68 typedef base::Callback<void( | 68 typedef base::Callback<void( |
| 69 int /* tag */, | 69 int /* tag */, |
| 70 bool /* success */, | 70 bool /* success */, |
| 71 SpellingServiceClient::ServiceType type, /* suggest or spellcheck */ |
| 71 const string16& /* text */, | 72 const string16& /* text */, |
| 72 const std::vector<SpellCheckResult>& /* results */)> | 73 const std::vector<SpellCheckResult>& /* results */)> |
| 73 TextCheckCompleteCallback; | 74 TextCheckCompleteCallback; |
| 74 | 75 |
| 75 SpellingServiceClient(); | 76 SpellingServiceClient(); |
| 76 virtual ~SpellingServiceClient(); | 77 virtual ~SpellingServiceClient(); |
| 77 | 78 |
| 78 // net::URLFetcherDelegate implementation. | 79 // net::URLFetcherDelegate implementation. |
| 79 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 80 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| 80 | 81 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 108 // Spelling service and parse it. | 109 // Spelling service and parse it. |
| 109 TextCheckCompleteCallback callback_; | 110 TextCheckCompleteCallback callback_; |
| 110 | 111 |
| 111 // The text checked by the Spelling service. | 112 // The text checked by the Spelling service. |
| 112 string16 text_; | 113 string16 text_; |
| 113 | 114 |
| 114 // The identifier provided by users so they can identify a text-check request. | 115 // The identifier provided by users so they can identify a text-check request. |
| 115 // When a JSON-RPC call finishes successfully, this value is used as the | 116 // When a JSON-RPC call finishes successfully, this value is used as the |
| 116 // first parameter to |callback_|. | 117 // first parameter to |callback_|. |
| 117 int tag_; | 118 int tag_; |
| 119 |
| 120 // The type of spelling request sent; |
| 121 ServiceType type_; |
| 118 }; | 122 }; |
| 119 | 123 |
| 120 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLING_SERVICE_CLIENT_H_ | 124 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLING_SERVICE_CLIENT_H_ |
| OLD | NEW |