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

Unified Diff: ui/base/ime/chromeos/mock_input_method_manager.cc

Issue 2953033002: Hide handwriting and voice buttons when keyboard is in restricted state (Closed)
Patch Set: 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: ui/base/ime/chromeos/mock_input_method_manager.cc
diff --git a/ui/base/ime/chromeos/mock_input_method_manager.cc b/ui/base/ime/chromeos/mock_input_method_manager.cc
index a28f490ee098993c70e1c5a2aabae56138a1d6ba..5b6d2052b63425f8def87a1590c17960d9e1b5ba 100644
--- a/ui/base/ime/chromeos/mock_input_method_manager.cc
+++ b/ui/base/ime/chromeos/mock_input_method_manager.cc
@@ -111,7 +111,8 @@ MockInputMethodManager::State::GetAllowedInputMethods() {
MockInputMethodManager::State::~State() {}
-MockInputMethodManager::MockInputMethodManager() {}
+MockInputMethodManager::MockInputMethodManager()
+ : features_restricted_state_(FeaturesRestricted::NONE) {}
MockInputMethodManager::~MockInputMethodManager() {}
@@ -202,5 +203,25 @@ bool MockInputMethodManager::IsEmojiHandwritingVoiceOnImeMenuEnabled() {
return true;
}
+void MockInputMethodManager::SetFeaturesRestricted(FeaturesRestricted feature,
+ bool restricted) {
+ if (feature == FeaturesRestricted::NONE) {
+ features_restricted_state_ =
+ restricted ? FeaturesRestricted::NONE : (~FeaturesRestricted::NONE);
+ } else {
+ if (restricted)
+ features_restricted_state_ |= feature;
+ else
+ features_restricted_state_ &= (~feature);
+ }
+}
+
+bool MockInputMethodManager::GetFeaturesRestricted(
+ FeaturesRestricted feature) const {
+ if (feature == FeaturesRestricted::NONE)
+ return features_restricted_state_ == FeaturesRestricted::NONE;
+ return (features_restricted_state_ & feature);
+}
+
} // namespace input_method
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698