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 #include "chrome/browser/spellchecker/spelling_service_client.h" | 5 #include "chrome/browser/spellchecker/spelling_service_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
20 #include "chrome/common/spellcheck_common.h" | 20 #include "chrome/common/spellcheck_common.h" |
21 #include "chrome/common/spellcheck_result.h" | 21 #include "chrome/common/spellcheck_result.h" |
22 #include "google_apis/google_api_keys.h" | 22 #include "google_apis/google_api_keys.h" |
23 #include "net/base/load_flags.h" | 23 #include "net/base/load_flags.h" |
24 #include "net/url_request/url_fetcher.h" | 24 #include "net/url_request/url_fetcher.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 fetcher->GetResponseAsString(&data); | 247 fetcher->GetResponseAsString(&data); |
248 success = ParseResponse(data, &results); | 248 success = ParseResponse(data, &results); |
249 } | 249 } |
250 callback_data->callback.Run(success, callback_data->text, results); | 250 callback_data->callback.Run(success, callback_data->text, results); |
251 spellcheck_fetchers_.erase(fetcher.get()); | 251 spellcheck_fetchers_.erase(fetcher.get()); |
252 } | 252 } |
253 | 253 |
254 net::URLFetcher* SpellingServiceClient::CreateURLFetcher(const GURL& url) { | 254 net::URLFetcher* SpellingServiceClient::CreateURLFetcher(const GURL& url) { |
255 return net::URLFetcher::Create(url, net::URLFetcher::POST, this); | 255 return net::URLFetcher::Create(url, net::URLFetcher::POST, this); |
256 } | 256 } |
OLD | NEW |