Skip to content

Commit

Permalink
VK API: added feature flag
Browse files Browse the repository at this point in the history
Guard the Show/Hide functionality behind this flag.

CRBUG=1231021

Change-Id: Ie54dc346127a4e1ebd61b32d259afd08bec6b563
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056324
Commit-Queue: Keith Lee <keithlee@chromium.org>
Reviewed-by: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#907030}
  • Loading branch information
Keith Lee authored and Chromium LUCI CQ committed Jul 30, 2021
1 parent d37e421 commit ad929a6
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ash/constants/ash_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,10 @@ const base::Feature kUserActivityPrediction{"UserActivityPrediction",
const base::Feature kVerticalSplitScreen{"VerticalSplitScreen",
base::FEATURE_DISABLED_BY_DEFAULT};

// Enable the Virtual Keyboard API.
const base::Feature kVirtualKeyboardApi{"VirtualKeyboardApi",
base::FEATURE_DISABLED_BY_DEFAULT};

// Enable or disable using the floating virtual keyboard as the default option
// on Chrome OS.
const base::Feature kVirtualKeyboardFloatingDefault{
Expand Down
2 changes: 2 additions & 0 deletions ash/constants/ash_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS)
extern const base::Feature kUserActivityPrediction;
COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kVerticalSplitScreen;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const base::Feature kVirtualKeyboardApi;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const base::Feature kVirtualKeyboardFloatingDefault;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const base::Feature kVirtualKeyboardBorderedKey;
Expand Down
11 changes: 7 additions & 4 deletions ash/keyboard/ui/keyboard_ui_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <set>

#include "ash/constants/ash_features.h"
#include "ash/keyboard/ui/container_floating_behavior.h"
#include "ash/keyboard/ui/container_full_width_behavior.h"
#include "ash/keyboard/ui/display_util.h"
Expand Down Expand Up @@ -851,10 +852,12 @@ void KeyboardUIController::OnShowVirtualKeyboardIfEnabled() {

void KeyboardUIController::OnVirtualKeyboardVisibilityChangedIfEnabled(
bool should_show) {
if (should_show) {
OnShowVirtualKeyboardIfEnabled();
} else {
HideKeyboardExplicitlyBySystem();
if (base::FeatureList::IsEnabled(chromeos::features::kVirtualKeyboardApi)) {
if (should_show) {
OnShowVirtualKeyboardIfEnabled();
} else {
HideKeyboardExplicitlyBySystem();
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4114,6 +4114,10 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kSystemLatinPhysicalTypingName,
flag_descriptions::kSystemLatinPhysicalTypingDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kSystemLatinPhysicalTyping)},
{"enable-cros-virtual-keyboard-api",
flag_descriptions::kVirtualKeyboardApiName,
flag_descriptions::kVirtualKeyboardApiDescription, kOsCrOS,
FEATURE_VALUE_TYPE(chromeos::features::kVirtualKeyboardApi)},
{"enable-cros-virtual-keyboard-bordered-key",
flag_descriptions::kVirtualKeyboardBorderedKeyName,
flag_descriptions::kVirtualKeyboardBorderedKeyDescription, kOsCrOS,
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/flag-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,11 @@
"owners": [ "shend", "essential-inputs-team@google.com" ],
"expiry_milestone": 95
},
{
"name": "enable-cros-virtual-keyboard-api",
"owners": [ "keithlee", "essential-inputs-team@google.com" ],
"expiry_milestone": 97
},
{
"name": "enable-cros-virtual-keyboard-bordered-key",
"owners": [ "essential-inputs-team@google.com" ],
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5251,6 +5251,10 @@ const char kVirtualKeyboardDescription[] =
"Always show virtual keyboard regardless of having a physical keyboard "
"present";

const char kVirtualKeyboardApiName[] = "Virtual Keyboard API";
const char kVirtualKeyboardApiDescription[] =
"Enable the JS Virtual keyboard API, allowing manual control of the VK.";

const char kVirtualKeyboardBorderedKeyName[] = "Virtual Keyboard Bordered Key";
const char kVirtualKeyboardBorderedKeyDescription[] =
"Show virtual keyboard with bordered key";
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3037,6 +3037,9 @@ extern const char kVaapiWebPImageDecodeAccelerationDescription[];
extern const char kVirtualKeyboardName[];
extern const char kVirtualKeyboardDescription[];

extern const char kVirtualKeyboardApiName[];
extern const char kVirtualKeyboardApiDescription[];

extern const char kVirtualKeyboardBorderedKeyName[];
extern const char kVirtualKeyboardBorderedKeyDescription[];

Expand Down
2 changes: 2 additions & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47430,6 +47430,7 @@ from previous Chrome versions.
<int value="-1383597259" label="SyncUserConsentSeparateType:disabled"/>
<int value="-1383145700"
label="AutofillDoNotMigrateUnsupportedLocalCards:enabled"/>
<int value="-1382918690" label="VirtualKeyboardApi:enabled"/>
<int value="-1382671832" label="OmniboxUIExperimentVerticalMargin:enabled"/>
<int value="-1378071979" label="CroshSWA:enabled"/>
<int value="-1377186702" label="DesktopIOSPromotion:disabled"/>
Expand Down Expand Up @@ -51455,6 +51456,7 @@ from previous Chrome versions.
<int value="1900529524" label="disable-touch-drag-drop"/>
<int value="1901640438" label="EnableLauncherSearchNormalization:disabled"/>
<int value="1903206193" label="NewWindowAppMenu:disabled"/>
<int value="1903444879" label="VirtualKeyboardApi:disabled"/>
<int value="1905465678" label="ContextualSearchSingleActions:enabled"/>
<int value="1906942630" label="enable-easy-unlock"/>
<int value="1907273605" label="NtpZeroSuggest:disabled"/>
Expand Down

0 comments on commit ad929a6

Please sign in to comment.