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

Unified Diff: components/spellcheck/common/spellcheck_features.cc

Issue 2284583002: [Android] Add AndroidSpellChecker feature to allow for gradual rollout using finch. (Closed)
Patch Set: fix compile 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 side-by-side diff with in-line comments
Download patch
Index: components/spellcheck/common/spellcheck_features.cc
diff --git a/components/spellcheck/common/spellcheck_features.cc b/components/spellcheck/common/spellcheck_features.cc
new file mode 100644
index 0000000000000000000000000000000000000000..33b2271f243cb5cc69c926ad22f67f619711d799
--- /dev/null
+++ b/components/spellcheck/common/spellcheck_features.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/spellcheck/common/spellcheck_features.h"
+
+#include "base/sys_info.h"
+
+namespace spellcheck {
+
+#if defined(ENABLE_SPELLCHECK) && defined(OS_ANDROID)
+
+// Enables/disables Android spellchecker.
+const base::Feature kAndroidSpellChecker{
+ "AndroidSpellChecker", base::FEATURE_DISABLED_BY_DEFAULT};
+
+// Enables/disables Android spellchecker on non low-end Android devices.
+const base::Feature kAndroidSpellCheckerNonLowEnd{
+ "AndroidSpellCheckerNonLowEnd", base::FEATURE_DISABLED_BY_DEFAULT};
+
+bool IsAndroidSpellCheckFeatureEnabled() {
+ if (base::FeatureList::IsEnabled(
+ spellcheck::kAndroidSpellCheckerNonLowEnd)) {
+ return !base::SysInfo::IsLowEndDevice();
+ }
+
+ if (base::FeatureList::IsEnabled(
+ spellcheck::kAndroidSpellChecker)) {
+ return true;
+ }
+
+ return false;
+}
+
+#endif // defined(ENABLE_SPELLCHECK) && defined(OS_ANDROID)
+
+} // namespace spellcheck
« no previous file with comments | « components/spellcheck/common/spellcheck_features.h ('k') | components/spellcheck/common/spellcheck_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698