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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 typedef base::Callback<void( | 65 typedef base::Callback<void( |
66 int /* tag */, | 66 int /* tag */, |
67 bool /* success */, | 67 bool /* success */, |
68 const std::vector<SpellCheckResult>& /* results */)> | 68 const std::vector<SpellCheckResult>& /* results */)> |
69 TextCheckCompleteCallback; | 69 TextCheckCompleteCallback; |
70 | 70 |
71 SpellingServiceClient(); | 71 SpellingServiceClient(); |
72 virtual ~SpellingServiceClient(); | 72 virtual ~SpellingServiceClient(); |
73 | 73 |
74 // content::URLFetcherDelegate implementation. | 74 // content::URLFetcherDelegate implementation. |
75 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; | 75 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
76 | 76 |
77 // Sends a text-check request to the Spelling service. When we send a request | 77 // Sends a text-check request to the Spelling service. When we send a request |
78 // to the Spelling service successfully, this function returns true. (This | 78 // to the Spelling service successfully, this function returns true. (This |
79 // does not mean the service finishes checking text successfully.) We will | 79 // does not mean the service finishes checking text successfully.) We will |
80 // call |callback| when we receive a text-check response from the service. | 80 // call |callback| when we receive a text-check response from the service. |
81 bool RequestTextCheck(Profile* profile, | 81 bool RequestTextCheck(Profile* profile, |
82 int tag, | 82 int tag, |
83 ServiceType type, | 83 ServiceType type, |
84 const string16& text, | 84 const string16& text, |
85 const TextCheckCompleteCallback& callback); | 85 const TextCheckCompleteCallback& callback); |
(...skipping 15 matching lines...) Expand all Loading... |
101 // Spelling service and parse it. | 101 // Spelling service and parse it. |
102 TextCheckCompleteCallback callback_; | 102 TextCheckCompleteCallback callback_; |
103 | 103 |
104 // The identifier provided by users so they can identify a text-check request. | 104 // The identifier provided by users so they can identify a text-check request. |
105 // When a JSON-RPC call finishes successfully, this value is used as the | 105 // When a JSON-RPC call finishes successfully, this value is used as the |
106 // first parameter to |callback_|. | 106 // first parameter to |callback_|. |
107 int tag_; | 107 int tag_; |
108 }; | 108 }; |
109 | 109 |
110 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLING_SERVICE_CLIENT_H_ | 110 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLING_SERVICE_CLIENT_H_ |
OLD | NEW |