summaryrefslogtreecommitdiffstats
path: root/components/autofill/core/common/autofill_util.cc
diff options
context:
space:
mode:
authorrouslan <rouslan@chromium.org>2015-08-24 10:33:52 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-24 17:34:31 +0000
commitc31f81d2b0da1ee93d6ae1995f50b3d733fcce1e (patch)
treed62c9a260795f6dee40489d386239a5d10993795 /components/autofill/core/common/autofill_util.cc
parent271aabbf5e115b95a072c9a32142c8c812fcd2d3 (diff)
downloadchromium_src-c31f81d2b0da1ee93d6ae1995f50b3d733fcce1e.zip
chromium_src-c31f81d2b0da1ee93d6ae1995f50b3d733fcce1e.tar.gz
chromium_src-c31f81d2b0da1ee93d6ae1995f50b3d733fcce1e.tar.bz2
Control keyboard accessory through field trial.
Field trial name: "AutofillKeyboardAccessory" Checked field trial value: "Enabled" Override the field trial: chrome://flags/#enable-autofill-keyboard-accessory-view BUG=428087 Review URL: https://codereview.chromium.org/1287113007 Cr-Commit-Position: refs/heads/master@{#345109}
Diffstat (limited to 'components/autofill/core/common/autofill_util.cc')
-rw-r--r--components/autofill/core/common/autofill_util.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/components/autofill/core/common/autofill_util.cc b/components/autofill/core/common/autofill_util.cc
index a313fc9..0ecb0a7 100644
--- a/components/autofill/core/common/autofill_util.cc
+++ b/components/autofill/core/common/autofill_util.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/i18n/case_conversion.h"
+#include "base/metrics/field_trial.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -41,6 +42,19 @@ bool IsFeatureSubstringMatchEnabled() {
switches::kEnableSuggestionsWithSubstringMatch);
}
+bool IsKeyboardAccessoryEnabled() {
+#if defined(OS_ANDROID)
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ autofill::switches::kEnableAccessorySuggestionView) ||
+ (base::FieldTrialList::FindFullName("AutofillKeyboardAccessory") ==
+ "Enabled" &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ autofill::switches::kDisableAccessorySuggestionView));
+#else // !defined(OS_ANDROID)
+ return false;
+#endif
+}
+
bool FieldIsSuggestionSubstringStartingOnTokenBoundary(
const base::string16& suggestion,
const base::string16& field_contents,