Chromium Code Reviews| Index: third_party/WebKit/public/web/WebTextCheckClient.h |
| diff --git a/third_party/WebKit/public/web/WebTextCheckClient.h b/third_party/WebKit/public/web/WebTextCheckClient.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c629fe792075460a6281eee261bf3f6a5f3b89c8 |
| --- /dev/null |
| +++ b/third_party/WebKit/public/web/WebTextCheckClient.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef WebTextCheckClient_h |
| +#define WebTextCheckClient_h |
| + |
| +#include "../platform/WebString.h" |
|
tkent
2017/04/04 01:58:18
Please avoid ".." in #includes. It should be "pub
Xiaocheng
2017/04/04 02:53:24
Done.
|
| +#include "../platform/WebVector.h" |
|
tkent
2017/04/04 01:58:18
Ditto.
|
| + |
| +namespace blink { |
| + |
| +class WebTextCheckingCompletion; |
| + |
| +class WebTextCheckClient { |
| + public: |
| + // The client should perform spell-checking on the given text. If the |
| + // text contains a misspelled word, then upon return misspelledOffset |
| + // will point to the start of the misspelled word, and misspelledLength |
| + // will indicates its length. Otherwise, if there was not a spelling |
| + // error, then upon return misspelledLength is 0. If optional_suggestions |
| + // is given, then it will be filled with suggested words (not a cheap step). |
| + virtual void checkSpelling(const WebString& text, |
| + int& misspelledOffset, |
| + int& misspelledLength, |
| + WebVector<WebString>* optionalSuggestions) {} |
| + |
| + // Requests asynchronous spelling and grammar checking, whose result should be |
| + // returned by passed completion object. |
| + virtual void requestCheckingOfText( |
| + const WebString& textToCheck, |
| + WebTextCheckingCompletion* completionCallback) {} |
| + |
| + // Clear all stored references to requests, so that it will not become a |
| + // leak source. |
| + virtual void cancelAllPendingRequests() {} |
| + |
| + protected: |
| + virtual ~WebTextCheckClient() {} |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif |