From ecb5ce9e46448cc06b2fc0735eff55129a0d3969 Mon Sep 17 00:00:00 2001 From: rsadam Date: Tue, 12 May 2015 09:24:53 -0700 Subject: [PATCH] Merge gesture deletion and selection. BUG= Review URL: https://codereview.chromium.org/1130833005 Cr-Commit-Position: refs/heads/master@{#329416} --- chrome/app/generated_resources.grd | 14 +++------ chrome/browser/about_flags.cc | 35 ++++++---------------- .../chrome_virtual_keyboard_delegate.cc | 4 +-- tools/metrics/histograms/histograms.xml | 1 + ui/keyboard/keyboard_switches.cc | 10 ++----- ui/keyboard/keyboard_switches.h | 22 +++++--------- ui/keyboard/keyboard_util.cc | 13 ++------ ui/keyboard/keyboard_util.h | 7 ++--- 8 files changed, 30 insertions(+), 76 deletions(-) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 06a7d77e3d80..03b55f81db35 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -14506,17 +14506,11 @@ After you create a new supervised user, you can manage their settings at any tim Enable/Disable gesture typing for the virtual keyboard. - - Gesture selection for the virtual keyboard. + + Gesture editing for the virtual keyboard. - - Enable/Disable gesture selection option in the settings page for the virtual keyboard. - - - Gesture deletion for the virtual keyboard. - - - Enable/Disable gesture deletion option in the settings page for the virtual keyboard. + + Enable/Disable gesture editing option in the settings page for the virtual keyboard. Disable bypass proxy for Captive Portal Authorization diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 7e511037aa4c..edb9981dab99 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -487,24 +487,14 @@ const Experiment::Choice kGestureTypingChoices[] = { keyboard::switches::kGestureTypingEnabled}, }; -const Experiment::Choice kGestureSelectionChoices[] = { +const Experiment::Choice kGestureEditingChoices[] = { { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, - keyboard::switches::kGestureSelection, - keyboard::switches::kGestureSelectionDisabled}, + keyboard::switches::kGestureEditing, + keyboard::switches::kGestureEditingDisabled}, { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, - keyboard::switches::kGestureSelection, - keyboard::switches::kGestureSelectionEnabled}, -}; - -const Experiment::Choice kGestureDeletionChoices[] = { - { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, - { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, - keyboard::switches::kGestureDeletion, - keyboard::switches::kGestureDeletionDisabled}, - { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, - keyboard::switches::kGestureDeletion, - keyboard::switches::kGestureDeletionEnabled}, + keyboard::switches::kGestureEditing, + keyboard::switches::kGestureEditingEnabled}, }; #endif @@ -1481,18 +1471,11 @@ const Experiment kExperiments[] = { MULTI_VALUE_TYPE(kGestureTypingChoices) }, { - "gesture-selection", - IDS_FLAGS_GESTURE_SELECTION_NAME, - IDS_FLAGS_GESTURE_SELECTION_DESCRIPTION, - kOsCrOS, - MULTI_VALUE_TYPE(kGestureSelectionChoices) - }, - { - "gesture-deletion", - IDS_FLAGS_GESTURE_DELETION_NAME, - IDS_FLAGS_GESTURE_DELETION_DESCRIPTION, + "gesture-editing", + IDS_FLAGS_GESTURE_EDITING_NAME, + IDS_FLAGS_GESTURE_EDITING_DESCRIPTION, kOsCrOS, - MULTI_VALUE_TYPE(kGestureDeletionChoices) + MULTI_VALUE_TYPE(kGestureEditingChoices) }, { "disable-smart-virtual-keyboard", diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc index 3fe29f2f282e..0c859235b15a 100644 --- a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc +++ b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc @@ -64,9 +64,7 @@ bool ChromeVirtualKeyboardDelegate::GetKeyboardConfig( features->AppendString( GenerateFeatureFlag("gesturetyping", keyboard::IsGestureTypingEnabled())); features->AppendString(GenerateFeatureFlag( - "gestureselection", keyboard::IsGestureSelectionEnabled())); - features->AppendString(GenerateFeatureFlag( - "gesturedeletion", keyboard::IsGestureDeletionEnabled())); + "gestureediting", keyboard::IsGestureEditingEnabled())); features->AppendString(GenerateFeatureFlag( "materialdesign", keyboard::IsMaterialDesignEnabled())); features->AppendString( diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 837befd5f9dd..0e06ed5e1f32 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -56196,6 +56196,7 @@ To add a new entry, add it with any value and run test to compute valid value. + diff --git a/ui/keyboard/keyboard_switches.cc b/ui/keyboard/keyboard_switches.cc index c02055299465..09d8fbce0994 100644 --- a/ui/keyboard/keyboard_switches.cc +++ b/ui/keyboard/keyboard_switches.cc @@ -20,13 +20,9 @@ const char kGestureTyping[] = "gesture-typing"; const char kGestureTypingEnabled[] = "enabled"; const char kGestureTypingDisabled[] = "disabled"; -const char kGestureSelection[] = "gesture-selection"; -const char kGestureSelectionEnabled[] = "enabled"; -const char kGestureSelectionDisabled[] = "disabled"; - -const char kGestureDeletion[] = "gesture-deletion"; -const char kGestureDeletionEnabled[] = "enabled"; -const char kGestureDeletionDisabled[] = "disabled"; +const char kGestureEditing[] = "gesture-editing"; +const char kGestureEditingEnabled[] = "enabled"; +const char kGestureEditingDisabled[] = "disabled"; const char kEnableVirtualKeyboard[] = "enable-virtual-keyboard"; const char kFloatingVirtualKeyboard[] = "floating-virtual-keyboard"; diff --git a/ui/keyboard/keyboard_switches.h b/ui/keyboard/keyboard_switches.h index f036161d9ec5..d9296ca01036 100644 --- a/ui/keyboard/keyboard_switches.h +++ b/ui/keyboard/keyboard_switches.h @@ -39,23 +39,15 @@ KEYBOARD_EXPORT extern const char kGestureTypingEnabled[]; // Disables gesture typing for the virtual keyboard. KEYBOARD_EXPORT extern const char kGestureTypingDisabled[]; -// Gesture selection for the virtual keyboard. -KEYBOARD_EXPORT extern const char kGestureSelection[]; +// Controls the appearance of the settings option to enable gesture editing +// for the virtual keyboard. +KEYBOARD_EXPORT extern const char kGestureEditing[]; -// Enables gesture selection for the virtual keyboard. -KEYBOARD_EXPORT extern const char kGestureSelectionEnabled[]; +// Enables gesture editing for the virtual keyboard. +KEYBOARD_EXPORT extern const char kGestureEditingEnabled[]; -// Disables gesture selection for the virtual keyboard. -KEYBOARD_EXPORT extern const char kGestureSelectionDisabled[]; - -// Gesture deletion for the virtual keyboard. -KEYBOARD_EXPORT extern const char kGestureDeletion[]; - -// Enables gesture deletion for the virtual keyboard. -KEYBOARD_EXPORT extern const char kGestureDeletionEnabled[]; - -// Disables gesture deletion for the virtual keyboard. -KEYBOARD_EXPORT extern const char kGestureDeletionDisabled[]; +// Disables gesture editing for the virtual keyboard. +KEYBOARD_EXPORT extern const char kGestureEditingDisabled[]; // Enables the virtual keyboard. KEYBOARD_EXPORT extern const char kEnableVirtualKeyboard[]; diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc index 85e41c413891..00b9f9e99d77 100644 --- a/ui/keyboard/keyboard_util.cc +++ b/ui/keyboard/keyboard_util.cc @@ -170,18 +170,11 @@ bool IsGestureTypingEnabled() { return keyboard_switch == switches::kGestureTypingEnabled; } -bool IsGestureSelectionEnabled() { +bool IsGestureEditingEnabled() { std::string keyboard_switch = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kGestureSelection); - return keyboard_switch != switches::kGestureSelectionDisabled; -} - -bool IsGestureDeletionEnabled() { - std::string keyboard_switch = - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kGestureDeletion); - return keyboard_switch != switches::kGestureDeletionDisabled; + switches::kGestureEditing); + return keyboard_switch == switches::kGestureEditingEnabled; } bool IsMaterialDesignEnabled() { diff --git a/ui/keyboard/keyboard_util.h b/ui/keyboard/keyboard_util.h index d41349f32b26..8f72556ca92a 100644 --- a/ui/keyboard/keyboard_util.h +++ b/ui/keyboard/keyboard_util.h @@ -99,11 +99,8 @@ KEYBOARD_EXPORT bool IsFloatingVirtualKeyboardEnabled(); // Returns true if gesture typing is enabled for virtual keyboard. KEYBOARD_EXPORT bool IsGestureTypingEnabled(); -// Returns true if gesture deletion is enabled for virtual keyboard. -KEYBOARD_EXPORT bool IsGestureDeletionEnabled(); - -// Returns true if gesture selection is enabled for virtual keyboard. -KEYBOARD_EXPORT bool IsGestureSelectionEnabled(); +// Returns true if gesture editing option is enabled for virtual keyboard. +KEYBOARD_EXPORT bool IsGestureEditingEnabled(); // Returns true if material design is enabled for the keyboard. KEYBOARD_EXPORT bool IsMaterialDesignEnabled(); -- 2.11.4.GIT