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

Side by Side 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, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ 5 #ifndef UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_
6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ 6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 std::string label; 58 std::string label;
59 MenuItemStyle style; 59 MenuItemStyle style;
60 bool visible; 60 bool visible;
61 bool enabled; 61 bool enabled;
62 bool checked; 62 bool checked;
63 63
64 unsigned int modified; 64 unsigned int modified;
65 std::vector<MenuItem> children; 65 std::vector<MenuItem> children;
66 }; 66 };
67 67
68 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
69 RESTRICTED_NONE = 0,
70 RESTRICTED_EMOJI = 1 << 0,
71 RESTRICTED_HANDWRITING = 1 << 1,
72 RESTRICTED_VOICE = 1 << 2,
73 };
74
68 class Observer { 75 class Observer {
69 public: 76 public:
70 virtual ~Observer() {} 77 virtual ~Observer() {}
71 // Called when the current input method is changed. |show_message| 78 // Called when the current input method is changed. |show_message|
72 // indicates whether the user should be notified of this change. 79 // indicates whether the user should be notified of this change.
73 virtual void InputMethodChanged(InputMethodManager* manager, 80 virtual void InputMethodChanged(InputMethodManager* manager,
74 Profile* profile, 81 Profile* profile,
75 bool show_message) = 0; 82 bool show_message) = 0;
76 }; 83 };
77 84
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 virtual void MaybeNotifyImeMenuActivationChanged() = 0; 320 virtual void MaybeNotifyImeMenuActivationChanged() = 0;
314 321
315 // Overrides the keyboard url ref (stuff following '#' to the end of the 322 // Overrides the keyboard url ref (stuff following '#' to the end of the
316 // string) with the given keyset (emoji, hwt or voice). If |keyset| is empty, 323 // string) with the given keyset (emoji, hwt or voice). If |keyset| is empty,
317 // it indicates that we should override the url back with the keyboard keyset. 324 // it indicates that we should override the url back with the keyboard keyset.
318 virtual void OverrideKeyboardUrlRef(const std::string& keyset) = 0; 325 virtual void OverrideKeyboardUrlRef(const std::string& keyset) = 0;
319 326
320 // Returns whether the extra inputs: emoji, handwriting and voice inputs on 327 // Returns whether the extra inputs: emoji, handwriting and voice inputs on
321 // opt-in IME menu has been enabled. 328 // opt-in IME menu has been enabled.
322 virtual bool IsEmojiHandwritingVoiceOnImeMenuEnabled() = 0; 329 virtual bool IsEmojiHandwritingVoiceOnImeMenuEnabled() = 0;
330
331 // Sets some advanced features, e.g. handwiring, voices input, in restricted
332 // state.
333 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
334 bool restricted) = 0;
335
336 // Returns the restricted state of the keyboard features.
337 virtual uint32_t GetFeaturesRestrictedState() = 0;
323 }; 338 };
324 339
325 } // namespace input_method 340 } // namespace input_method
326 } // namespace chromeos 341 } // namespace chromeos
327 342
328 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ 343 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698