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

Side by Side Diff: components/spellcheck/common/spellcheck_features.cc

Issue 2495193003: Convert spellcheck to a buildflag header. (Closed)
Patch Set: Comment Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/spellcheck_features.h" 5 #include "components/spellcheck/common/spellcheck_features.h"
6 6
7 #include "base/sys_info.h" 7 #include "base/sys_info.h"
8 #include "components/spellcheck/spellcheck_build_features.h"
8 9
9 namespace spellcheck { 10 namespace spellcheck {
10 11
11 #if defined(ENABLE_SPELLCHECK) && defined(OS_ANDROID) 12 #if BUILDFLAG(ENABLE_SPELLCHECK) && defined(OS_ANDROID)
12 13
13 // Enables/disables Android spellchecker. 14 // Enables/disables Android spellchecker.
14 const base::Feature kAndroidSpellChecker{ 15 const base::Feature kAndroidSpellChecker{
15 "AndroidSpellChecker", base::FEATURE_DISABLED_BY_DEFAULT}; 16 "AndroidSpellChecker", base::FEATURE_DISABLED_BY_DEFAULT};
16 17
17 // Enables/disables Android spellchecker on non low-end Android devices. 18 // Enables/disables Android spellchecker on non low-end Android devices.
18 const base::Feature kAndroidSpellCheckerNonLowEnd{ 19 const base::Feature kAndroidSpellCheckerNonLowEnd{
19 "AndroidSpellCheckerNonLowEnd", base::FEATURE_DISABLED_BY_DEFAULT}; 20 "AndroidSpellCheckerNonLowEnd", base::FEATURE_DISABLED_BY_DEFAULT};
20 21
21 bool IsAndroidSpellCheckFeatureEnabled() { 22 bool IsAndroidSpellCheckFeatureEnabled() {
22 if (base::FeatureList::IsEnabled( 23 if (base::FeatureList::IsEnabled(
23 spellcheck::kAndroidSpellCheckerNonLowEnd)) { 24 spellcheck::kAndroidSpellCheckerNonLowEnd)) {
24 return !base::SysInfo::IsLowEndDevice(); 25 return !base::SysInfo::IsLowEndDevice();
25 } 26 }
26 27
27 if (base::FeatureList::IsEnabled( 28 if (base::FeatureList::IsEnabled(
28 spellcheck::kAndroidSpellChecker)) { 29 spellcheck::kAndroidSpellChecker)) {
29 return true; 30 return true;
30 } 31 }
31 32
32 return false; 33 return false;
33 } 34 }
34 35
35 #endif // defined(ENABLE_SPELLCHECK) && defined(OS_ANDROID) 36 #endif // BUILDFLAG(ENABLE_SPELLCHECK) && defined(OS_ANDROID)
36 37
37 } // namespace spellcheck 38 } // namespace spellcheck
OLDNEW
« no previous file with comments | « components/spellcheck/common/spellcheck_features.h ('k') | components/spellcheck/common/spellcheck_message_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698