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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 2953033002: Hide handwriting and voice buttons when keyboard is in restricted state (Closed)
Patch Set: Rename Set/GetImeMenuFeatureEnabled Created 3 years, 6 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: chrome/browser/chromeos/input_method/input_method_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index 4c74e466eddc23dc55a9b84548cc256b0a8a826f..56a1ddec9ff9030c8a60389c7f286d30c93a2032 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -859,7 +859,8 @@ InputMethodManagerImpl::InputMethodManagerImpl(
util_(delegate_.get()),
component_extension_ime_manager_(new ComponentExtensionIMEManager()),
enable_extension_loading_(enable_extension_loading),
- is_ime_menu_activated_(false) {
+ is_ime_menu_activated_(false),
+ features_enabled_state_(~0) {
James Cook 2017/06/29 16:48:29 nit: add an enum value like FEATURE_ALL = ~0 and
Azure Wei 2017/06/30 03:09:37 Done.
if (IsRunningAsSystemCompositor()) {
#if defined(USE_OZONE)
keyboard_ = base::MakeUnique<ImeKeyboardMus>(
@@ -1275,5 +1276,18 @@ bool InputMethodManagerImpl::IsEmojiHandwritingVoiceOnImeMenuEnabled() {
return base::FeatureList::IsEnabled(features::kEHVInputOnImeMenu);
}
+void InputMethodManagerImpl::SetImeMenuFeatureEnabled(ImeMenuFeature feature,
+ bool enabled) {
+ if (enabled)
+ features_enabled_state_ |= feature;
+ else
+ features_enabled_state_ &= ~feature;
+}
+
+bool InputMethodManagerImpl::GetImeMenuFeatureEnabled(
+ ImeMenuFeature feature) const {
+ return features_enabled_state_ & feature;
+}
+
} // namespace input_method
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698