Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: components/spellcheck/browser/spelling_service_client.cc

Issue 2254533003: Rename spellcheck::pref::kEnableContinuousSpellcheck to ...::kEnableSpellcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/spellcheck/browser/pref_names.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/spellcheck/browser/spelling_service_client.h" 5 #include "components/spellcheck/browser/spelling_service_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 return true; 117 return true;
118 } 118 }
119 119
120 bool SpellingServiceClient::IsAvailable(content::BrowserContext* context, 120 bool SpellingServiceClient::IsAvailable(content::BrowserContext* context,
121 ServiceType type) { 121 ServiceType type) {
122 const PrefService* pref = user_prefs::UserPrefs::Get(context); 122 const PrefService* pref = user_prefs::UserPrefs::Get(context);
123 DCHECK(pref); 123 DCHECK(pref);
124 // If prefs don't allow spellchecking, if the context is off the record, or if 124 // If prefs don't allow spellchecking, if the context is off the record, or if
125 // multilingual spellchecking is enabled the spelling service should be 125 // multilingual spellchecking is enabled the spelling service should be
126 // unavailable. 126 // unavailable.
127 if (!pref->GetBoolean(spellcheck::prefs::kEnableContinuousSpellcheck) || 127 if (!pref->GetBoolean(spellcheck::prefs::kEnableSpellcheck) ||
128 !pref->GetBoolean(spellcheck::prefs::kSpellCheckUseSpellingService) || 128 !pref->GetBoolean(spellcheck::prefs::kSpellCheckUseSpellingService) ||
129 context->IsOffTheRecord()) 129 context->IsOffTheRecord())
130 return false; 130 return false;
131 131
132 // If the locale for spelling has not been set, the user has not decided to 132 // If the locale for spelling has not been set, the user has not decided to
133 // use spellcheck so we don't do anything remote (suggest or spelling). 133 // use spellcheck so we don't do anything remote (suggest or spelling).
134 std::string locale; 134 std::string locale;
135 pref->GetList(spellcheck::prefs::kSpellCheckDictionaries) 135 pref->GetList(spellcheck::prefs::kSpellCheckDictionaries)
136 ->GetString(0, &locale); 136 ->GetString(0, &locale);
137 if (locale.empty()) 137 if (locale.empty())
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 // The callback may release the last (transitive) dependency on |this|. It 266 // The callback may release the last (transitive) dependency on |this|. It
267 // MUST be the last function called. 267 // MUST be the last function called.
268 callback_data->callback.Run(success, callback_data->text, results); 268 callback_data->callback.Run(success, callback_data->text, results);
269 } 269 }
270 270
271 std::unique_ptr<net::URLFetcher> SpellingServiceClient::CreateURLFetcher( 271 std::unique_ptr<net::URLFetcher> SpellingServiceClient::CreateURLFetcher(
272 const GURL& url) { 272 const GURL& url) {
273 return net::URLFetcher::Create(url, net::URLFetcher::POST, this); 273 return net::URLFetcher::Create(url, net::URLFetcher::POST, this);
274 } 274 }
OLDNEW
« no previous file with comments | « components/spellcheck/browser/pref_names.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698