diff options
-rw-r--r-- | chrome/app/chromeos_strings.grdp | 10 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 3 | ||||
-rw-r--r-- | chrome/browser/chromeos/extensions/input_method_api.cc | 11 | ||||
-rw-r--r-- | chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc | 5 | ||||
-rw-r--r-- | chrome/browser/chromeos/preferences.cc | 7 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/browser_options_handler.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_features.cc | 6 | ||||
-rw-r--r-- | chrome/common/chrome_features.h | 4 | ||||
-rw-r--r-- | chromeos/chromeos_switches.cc | 8 | ||||
-rw-r--r-- | chromeos/chromeos_switches.h | 4 |
10 files changed, 37 insertions, 24 deletions
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 61ad9c7..dcdea73 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp @@ -3633,8 +3633,8 @@ Press any key to continue exploring. This language doesn't have any input methods </message> <message name="IDS_OPTIONS_SETTINGS_LANGUAGES_ACTIVATE_IME_MENU" - desc="The label for activating IME menu on the shelf."> - Show the input method menu on the shelf. + desc="The label for showing expanded IME menu in the shelf."> + Show expanded input options in the shelf. </message> <message name="IDS_OPTIONS_SETTINGS_LANGUAGES_ACTIVATE_IME_MENU_DESCRIPTION" desc="The label for the description of showing input method menu."> @@ -6539,4 +6539,10 @@ All users must sign out to continue. <message name="IDS_ARC_SERVER_COMMUNICATION_ERROR" desc="Android sign-in error because of server communication error"> Server communication error </message> + <message name="IDS_FLAGS_ENABLE_IME_MENU_NAME" desc="Name of the about: flag for enabling opt-in IME menu."> + Enable opt-in IME menu + </message> + <message name="IDS_FLAGS_ENABLE_IME_MENU_DESCRIPTION" desc="Description of the about: flag for enabling opt-in IME menu."> + Enable access to the new IME menu in the Language Settings page. + </message> </grit-part> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 713c62d..320b7ec 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1822,6 +1822,9 @@ const FeatureEntry kFeatureEntries[] = { IDS_FLAGS_EXPERIMENTAL_ACCESSIBILITY_FEATURES_DESCRIPTION, kOsCrOS, SINGLE_VALUE_TYPE( chromeos::switches::kEnableExperimentalAccessibilityFeatures)}, + {"opt-in-ime-menu", IDS_FLAGS_ENABLE_IME_MENU_NAME, + IDS_FLAGS_ENABLE_IME_MENU_DESCRIPTION, kOsCrOS, + FEATURE_VALUE_TYPE(features::kOptInImeMenu)}, #endif // NOTE: Adding new command-line switches requires adding corresponding // entries to enum "LoginCustomFlags" in histograms.xml. See note in diff --git a/chrome/browser/chromeos/extensions/input_method_api.cc b/chrome/browser/chromeos/extensions/input_method_api.cc index de4d01d..debfdf6 100644 --- a/chrome/browser/chromeos/extensions/input_method_api.cc +++ b/chrome/browser/chromeos/extensions/input_method_api.cc @@ -22,6 +22,7 @@ #include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/extensions/api/input_method_private.h" #include "chrome/common/pref_names.h" #include "chromeos/chromeos_switches.h" @@ -71,11 +72,11 @@ InputMethodPrivateGetInputMethodConfigFunction::Run() { "isPhysicalKeyboardAutocorrectEnabled", !base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kDisablePhysicalKeyboardAutocorrect)); - output->SetBoolean( - "isImeMenuActivated", - chromeos::switches::IsImeMenuEnabled() && - Profile::FromBrowserContext(browser_context())->GetPrefs() - ->GetBoolean(prefs::kLanguageImeMenuActivated)); + output->SetBoolean("isImeMenuActivated", + base::FeatureList::IsEnabled(features::kOptInImeMenu) && + Profile::FromBrowserContext(browser_context()) + ->GetPrefs() + ->GetBoolean(prefs::kLanguageImeMenuActivated)); return RespondNow(OneArgument(output)); #endif } diff --git a/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc b/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc index d7bb49d..454129a 100644 --- a/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc +++ b/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc @@ -11,12 +11,14 @@ #include "base/strings/stringprintf.h" #include "chrome/browser/chromeos/extensions/input_method_event_router.h" #include "chrome/browser/chromeos/input_method/input_method_util.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chromeos/chromeos_switches.h" #include "components/prefs/pref_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_service.h" +#include "content/public/common/content_switches.h" #include "extensions/common/switches.h" #include "extensions/browser/api/test/test_api.h" #include "extensions/browser/notification_types.h" @@ -76,7 +78,8 @@ class ExtensionInputMethodApiTest : public ExtensionApiTest { command_line->AppendSwitchASCII( extensions::switches::kWhitelistedExtensionID, "ilanclmaeigfpnmdlgelmhkpkegdioip"); - command_line->AppendSwitch(chromeos::switches::kEnableImeMenu); + command_line->AppendSwitchASCII(switches::kEnableFeatures, + features::kOptInImeMenu.name); } }; diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index ed640bd..cb243aa 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -26,7 +26,7 @@ #include "chrome/browser/chromeos/system/input_device_settings.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/prefs/pref_service_syncable_util.h" -#include "chrome/common/chrome_switches.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chromeos/chromeos_switches.h" #include "chromeos/system/statistics_provider.h" @@ -335,7 +335,8 @@ void Preferences::InitUserPrefs(syncable_prefs::PrefServiceSyncable* prefs) { prefs, callback); ime_menu_activated_.Init(prefs::kLanguageImeMenuActivated, prefs, callback); // Notifies the system tray to remove the IME items. - if (switches::IsImeMenuEnabled() && ime_menu_activated_.GetValue()) + if (base::FeatureList::IsEnabled(features::kOptInImeMenu) && + ime_menu_activated_.GetValue()) input_method::InputMethodManager::Get()->ImeMenuActivationChanged(true); xkb_auto_repeat_enabled_.Init( @@ -604,7 +605,7 @@ void Preferences::ApplyPreferences(ApplyReason reason, if (pref_name == prefs::kLanguageImeMenuActivated && (reason == REASON_PREF_CHANGED || reason == REASON_ACTIVE_USER_CHANGED) && - switches::IsImeMenuEnabled()) { + base::FeatureList::IsEnabled(features::kOptInImeMenu)) { const bool activated = ime_menu_activated_.GetValue(); input_method::InputMethodManager::Get()->ImeMenuActivationChanged( activated); diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index b428690..d4e5d6e 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -59,6 +59,7 @@ #include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/browser/ui/webui/profile_helper.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_constants.h" @@ -717,7 +718,7 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) { Profile::FromWebUI(web_ui())->GetPrefs()->GetBoolean( prefs::kResolveTimezoneByGeolocation)); values->SetBoolean("enableLanguageOptionsImeMenu", - chromeos::switches::IsImeMenuEnabled()); + base::FeatureList::IsEnabled(features::kOptInImeMenu)); values->SetBoolean( "enableExperimentalAccessibilityFeatures", base::CommandLine::ForCurrentProcess()->HasSwitch( diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index e1c558b..300615b 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc @@ -56,4 +56,10 @@ const base::Feature kSyzyasanDeferredFree{"SyzyasanDeferredFree", base::FEATURE_DISABLED_BY_DEFAULT}; #endif +#if defined(OS_CHROMEOS) +// Enables or disables the opt-in IME menu in the language settings page. +const base::Feature kOptInImeMenu{"OptInImeMenu", + base::FEATURE_ENABLED_BY_DEFAULT}; +#endif // defined(OS_CHROMEOS) + } // namespace features diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index c0910bca..72acfa6 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h @@ -35,6 +35,10 @@ extern const base::Feature kSimplifiedFullscreenUI; extern const base::Feature kSyzyasanDeferredFree; #endif +#if defined(OS_CHROMEOS) +extern const base::Feature kOptInImeMenu; +#endif // defined(OS_CHROMEOS) + // DON'T ADD RANDOM STUFF HERE. Put it in the main section above in // alphabetical order, or in one of the ifdefs (also in order in each section). diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc index 987984b..3382113 100644 --- a/chromeos/chromeos_switches.cc +++ b/chromeos/chromeos_switches.cc @@ -353,10 +353,6 @@ const char kCrosRegionsModeHide[] = "hide"; // Forces CrOS region value. const char kCrosRegion[] = "cros-region"; -// Enables or disables the opt-in IME menu. -const char kEnableImeMenu[] = "enable-ime-menu"; -const char kDisableImeMenu[] = "disable-ime-menu"; - // Controls CrOS GaiaId migration for tests: // "" - default, // "started" - migration started (i.e. all stored user keys will be converted @@ -410,10 +406,6 @@ GetMemoryPressureThresholds() { return MemoryPressureMonitor::THRESHOLD_DEFAULT; } -bool IsImeMenuEnabled() { - return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableImeMenu); -} - bool IsGaiaIdMigrationStarted() { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(kTestCrosGaiaIdMigration)) diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h index fa61ba5..58a4bff 100644 --- a/chromeos/chromeos_switches.h +++ b/chromeos/chromeos_switches.h @@ -44,7 +44,6 @@ CHROMEOS_EXPORT extern const char kDisableDemoMode[]; CHROMEOS_EXPORT extern const char kDisableDeviceDisabling[]; CHROMEOS_EXPORT extern const char kDisableGaiaServices[]; CHROMEOS_EXPORT extern const char kDisableHIDDetectionOnOOBE[]; -CHROMEOS_EXPORT extern const char kDisableImeMenu[]; CHROMEOS_EXPORT extern const char kDisableLoginAnimations[]; CHROMEOS_EXPORT extern const char kDisableMemoryPressureSystemChromeOS[]; CHROMEOS_EXPORT extern const char kDisableMtpWriteSupport[]; @@ -66,7 +65,6 @@ CHROMEOS_EXPORT extern const char kEnableExperimentalAccessibilityFeatures[]; CHROMEOS_EXPORT extern const char kEnableExtensionAssetsSharing[]; CHROMEOS_EXPORT extern const char kEnableFilesDetailsPanel[]; CHROMEOS_EXPORT extern const char kEnableFirstRunUITransitions[]; -CHROMEOS_EXPORT extern const char kEnableImeMenu[]; CHROMEOS_EXPORT extern const char kEnableKioskMode[]; CHROMEOS_EXPORT extern const char kEnableNetworkPortalNotification[]; CHROMEOS_EXPORT extern const char kDisableNewKoreanIme[]; @@ -128,8 +126,6 @@ CHROMEOS_EXPORT bool MemoryPressureHandlingEnabled(); CHROMEOS_EXPORT base::chromeos::MemoryPressureMonitor::MemoryPressureThresholds GetMemoryPressureThresholds(); -CHROMEOS_EXPORT bool IsImeMenuEnabled(); - CHROMEOS_EXPORT bool IsGaiaIdMigrationStarted(); } // namespace switches } // namespace chromeos |