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

Unified Diff: components/spellcheck/browser/spelling_service_client.cc

Issue 2159283003: [WIP][DO NOT LAND] Componentize spellcheck Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/spellcheck/browser/spelling_service_client.cc
diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/components/spellcheck/browser/spelling_service_client.cc
similarity index 93%
rename from chrome/browser/spellchecker/spelling_service_client.cc
rename to components/spellcheck/browser/spelling_service_client.cc
index f7d2321511979bd6c1c2853b923a441a2bc0925b..2c9652dc080b5f372a3d7d04de08c52ccc7dccaa 100644
--- a/chrome/browser/spellchecker/spelling_service_client.cc
+++ b/components/spellcheck/browser/spelling_service_client.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/spellchecker/spelling_service_client.h"
+#include "components/spellcheck/browser/spelling_service_client.h"
#include <stddef.h>
@@ -16,9 +16,9 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/common/spellcheck_common.h"
-#include "chrome/common/spellcheck_result.h"
+#include "components/spellcheck/browser/pref_names.h"
+#include "components/spellcheck/common/spellcheck_common.h"
+#include "components/spellcheck/common/spellcheck_result.h"
#include "components/data_use_measurement/core/data_use_user_data.h"
#include "components/prefs/pref_service.h"
#include "components/user_prefs/user_prefs.h"
@@ -69,11 +69,11 @@ bool SpellingServiceClient::RequestTextCheck(
DCHECK(pref);
std::string dictionary;
- pref->GetList(prefs::kSpellCheckDictionaries)->GetString(0, &dictionary);
+ pref->GetList(spellcheck::prefs::kSpellCheckDictionaries)->GetString(0, &dictionary);
std::string language_code;
std::string country_code;
- chrome::spellcheck_common::GetISOLanguageCountryCodeFromLocale(
+ spellcheck_common::GetISOLanguageCountryCodeFromLocale(
dictionary, &language_code, &country_code);
// Replace typographical apostrophes with typewriter apostrophes, so that
@@ -130,15 +130,15 @@ bool SpellingServiceClient::IsAvailable(
// If prefs don't allow spellchecking, if the context is off the record, or if
// multilingual spellchecking is enabled the spelling service should be
// unavailable.
- if (!pref->GetBoolean(prefs::kEnableContinuousSpellcheck) ||
- !pref->GetBoolean(prefs::kSpellCheckUseSpellingService) ||
+ if (!pref->GetBoolean(spellcheck::prefs::kEnableContinuousSpellcheck) ||
+ !pref->GetBoolean(spellcheck::prefs::kSpellCheckUseSpellingService) ||
context->IsOffTheRecord())
return false;
// If the locale for spelling has not been set, the user has not decided to
// use spellcheck so we don't do anything remote (suggest or spelling).
std::string locale;
- pref->GetList(prefs::kSpellCheckDictionaries)->GetString(0, &locale);
+ pref->GetList(spellcheck::prefs::kSpellCheckDictionaries)->GetString(0, &locale);
if (locale.empty())
return false;
« no previous file with comments | « components/spellcheck/browser/spelling_service_client.h ('k') | components/spellcheck/browser/word_trimmer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698