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

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: Add InputMethodManager::FeaturesRestrictedState 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 2c2eff8d4715f9642fdfe7e5d4098915ea96120c..a6ee42a422795bbbf241ce7e96977945f5850681 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -929,7 +929,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_restricted_state_(FeaturesRestrictedState::RESTRICTED_NONE) {
if (IsRunningAsSystemCompositor()) {
#if defined(USE_OZONE)
keyboard_ = base::MakeUnique<ImeKeyboardMus>(
@@ -1345,5 +1346,19 @@ bool InputMethodManagerImpl::IsEmojiHandwritingVoiceOnImeMenuEnabled() {
return base::FeatureList::IsEnabled(features::kEHVInputOnImeMenu);
}
+void InputMethodManagerImpl::SetFeaturesRestrictedState(
+ FeaturesRestrictedState feature,
+ bool restricted) {
+ if (restricted) {
sky 2017/06/26 15:55:12 no {}
Azure Wei 2017/06/27 14:27:15 Done.
+ features_restricted_state_ |= feature;
+ } else {
+ features_restricted_state_ &= (~feature);
+ }
+}
+
+uint32_t InputMethodManagerImpl::GetFeaturesRestrictedState() {
+ return features_restricted_state_;
+}
+
} // namespace input_method
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698