| 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 COMPONENTS_SPELLCHECK_BROWSER_SPELLING_SERVICE_CLIENT_H_ | 5 #ifndef COMPONENTS_SPELLCHECK_BROWSER_SPELLING_SERVICE_CLIENT_H_ |
| 6 #define COMPONENTS_SPELLCHECK_BROWSER_SPELLING_SERVICE_CLIENT_H_ | 6 #define COMPONENTS_SPELLCHECK_BROWSER_SPELLING_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "net/traffic_annotation/network_traffic_annotation.h" |
| 16 #include "net/url_request/url_fetcher_delegate.h" | 17 #include "net/url_request/url_fetcher_delegate.h" |
| 17 | 18 |
| 18 class GURL; | 19 class GURL; |
| 19 class TextCheckClientDelegate; | 20 class TextCheckClientDelegate; |
| 20 struct SpellCheckResult; | 21 struct SpellCheckResult; |
| 21 | 22 |
| 22 namespace content { | 23 namespace content { |
| 23 class BrowserContext; | 24 class BrowserContext; |
| 24 } | 25 } |
| 25 | 26 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // The text checked by the Spelling service. | 113 // The text checked by the Spelling service. |
| 113 base::string16 text; | 114 base::string16 text; |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 // net::URLFetcherDelegate implementation. | 117 // net::URLFetcherDelegate implementation. |
| 117 void OnURLFetchComplete(const net::URLFetcher* source) override; | 118 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 118 | 119 |
| 119 // Creates a URLFetcher object used for sending a JSON-RPC request. This | 120 // Creates a URLFetcher object used for sending a JSON-RPC request. This |
| 120 // function is overridden by unit tests to prevent them from actually sending | 121 // function is overridden by unit tests to prevent them from actually sending |
| 121 // requests to the Spelling service. | 122 // requests to the Spelling service. |
| 122 virtual std::unique_ptr<net::URLFetcher> CreateURLFetcher(const GURL& url); | 123 virtual std::unique_ptr<net::URLFetcher> CreateURLFetcher( |
| 124 const GURL& url, |
| 125 net::NetworkTrafficAnnotationTag traffic_annotation); |
| 123 | 126 |
| 124 // The URLFetcher object used for sending a JSON-RPC request. | 127 // The URLFetcher object used for sending a JSON-RPC request. |
| 125 std::map<const net::URLFetcher*, std::unique_ptr<TextCheckCallbackData>> | 128 std::map<const net::URLFetcher*, std::unique_ptr<TextCheckCallbackData>> |
| 126 spellcheck_fetchers_; | 129 spellcheck_fetchers_; |
| 127 }; | 130 }; |
| 128 | 131 |
| 129 #endif // COMPONENTS_SPELLCHECK_BROWSER_SPELLING_SERVICE_CLIENT_H_ | 132 #endif // COMPONENTS_SPELLCHECK_BROWSER_SPELLING_SERVICE_CLIENT_H_ |
| OLD | NEW |