Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 FeaturesRestricted { | |
| 69 NONE = 0, | |
| 70 EMOJI = 1 << 0, | |
|
James Cook
2017/06/27 16:31:11
If you use enum instead of enum class these should
Azure Wei
2017/06/29 16:37:03
Done.
| |
| 71 HANDWRITING = 1 << 1, | |
| 72 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 // is different from previous. | 319 // is different from previous. |
| 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; |
|
James Cook
2017/06/27 16:31:11
This function partially duplicates GetFeaturesRest
Azure Wei
2017/06/29 16:37:03
This is a different condition. IsEmojiHandwritingV
| |
| 330 | |
| 331 // Sets some advanced features, e.g. handwiring, voices input, in restricted | |
| 332 // state. | |
| 333 virtual void SetFeaturesRestricted(FeaturesRestricted feature, | |
|
James Cook
2017/06/27 16:31:11
Please use positive sense booleans, so SetFeatureE
Azure Wei
2017/06/29 16:37:03
Done.
| |
| 334 bool restricted) = 0; | |
| 335 | |
| 336 // Returns the restricted state of the given keyboard feature. | |
| 337 virtual bool GetFeaturesRestricted(FeaturesRestricted feature) const = 0; | |
|
James Cook
2017/06/27 16:31:11
GetFeatureEnabled() or GetImeMenuFeatureEnabled()
Azure Wei
2017/06/29 16:37:03
Done.
| |
| 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_ |
| OLD | NEW |