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

Unified Diff: ui/base/ime/chromeos/input_method_manager.h

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: ui/base/ime/chromeos/input_method_manager.h
diff --git a/ui/base/ime/chromeos/input_method_manager.h b/ui/base/ime/chromeos/input_method_manager.h
index 2ad022ddf63351a5098debb687538c34c4e8a0c0..1640af0b19eaf2f7563e69673c840e70df20ba72 100644
--- a/ui/base/ime/chromeos/input_method_manager.h
+++ b/ui/base/ime/chromeos/input_method_manager.h
@@ -65,6 +65,13 @@ class UI_BASE_IME_EXPORT InputMethodManager {
std::vector<MenuItem> children;
};
+ enum FeaturesRestrictedState {
James Cook 2017/06/26 17:21:19 If you keep this, prefer "enum class", like Featur
Azure Wei 2017/06/27 14:27:15 Using 'enum class', it cannot be operanded to bina
James Cook 2017/06/27 16:31:10 You can do it with static_cast<>. But I agree it's
+ RESTRICTED_NONE = 0,
+ RESTRICTED_EMOJI = 1 << 0,
+ RESTRICTED_HANDWRITING = 1 << 1,
+ RESTRICTED_VOICE = 1 << 2,
+ };
+
class Observer {
public:
virtual ~Observer() {}
@@ -320,6 +327,14 @@ class UI_BASE_IME_EXPORT InputMethodManager {
// Returns whether the extra inputs: emoji, handwriting and voice inputs on
// opt-in IME menu has been enabled.
virtual bool IsEmojiHandwritingVoiceOnImeMenuEnabled() = 0;
+
+ // Sets some advanced features, e.g. handwiring, voices input, in restricted
+ // state.
+ virtual void SetFeaturesRestrictedState(FeaturesRestrictedState feature,
sky 2017/06/26 15:55:12 How come this function doesn't take a uint32_t tha
Azure Wei 2017/06/27 14:27:15 I want to hide the state behind. I changed GetFeat
+ bool restricted) = 0;
+
+ // Returns the restricted state of the keyboard features.
+ virtual uint32_t GetFeaturesRestrictedState() = 0;
};
} // namespace input_method

Powered by Google App Engine
This is Rietveld 408576698