| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_CLIENT_FEATURE_IME_FEATURE_H_ | 5 #ifndef BLIMP_CLIENT_FEATURE_IME_FEATURE_H_ |
| 6 #define BLIMP_CLIENT_FEATURE_IME_FEATURE_H_ | 6 #define BLIMP_CLIENT_FEATURE_IME_FEATURE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Any time user taps on an input text, ImeMessage::SHOW_IME message will be | 26 // Any time user taps on an input text, ImeMessage::SHOW_IME message will be |
| 27 // sent to client. Similarly, any time the text input is out of focus (e.g. if | 27 // sent to client. Similarly, any time the text input is out of focus (e.g. if |
| 28 // user navigates away from the currently page or the page loads for the first | 28 // user navigates away from the currently page or the page loads for the first |
| 29 // time), ImeMessage::HIDE_IME will be sent. | 29 // time), ImeMessage::HIDE_IME will be sent. |
| 30 | 30 |
| 31 class ImeFeature : public BlimpMessageProcessor { | 31 class ImeFeature : public BlimpMessageProcessor { |
| 32 public: | 32 public: |
| 33 // A delegate to be notified of text input requests. | 33 // A delegate to be notified of text input requests. |
| 34 class Delegate { | 34 class Delegate { |
| 35 public: | 35 public: |
| 36 virtual ~Delegate() {} |
| 36 virtual void OnShowImeRequested(ui::TextInputType input_type, | 37 virtual void OnShowImeRequested(ui::TextInputType input_type, |
| 37 const std::string& text) = 0; | 38 const std::string& text) = 0; |
| 38 virtual void OnHideImeRequested() = 0; | 39 virtual void OnHideImeRequested() = 0; |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 ImeFeature(); | 42 ImeFeature(); |
| 42 ~ImeFeature() override; | 43 ~ImeFeature() override; |
| 43 | 44 |
| 44 // Set the BlimpMessageProcessor that will be used to send BlimpMessage::IME | 45 // Set the BlimpMessageProcessor that will be used to send BlimpMessage::IME |
| 45 // messages to the engine. | 46 // messages to the engine. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 75 // Used to send BlimpMessage::IME messages to the engine. | 76 // Used to send BlimpMessage::IME messages to the engine. |
| 76 std::unique_ptr<BlimpMessageProcessor> outgoing_message_processor_; | 77 std::unique_ptr<BlimpMessageProcessor> outgoing_message_processor_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(ImeFeature); | 79 DISALLOW_COPY_AND_ASSIGN(ImeFeature); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace client | 82 } // namespace client |
| 82 } // namespace blimp | 83 } // namespace blimp |
| 83 | 84 |
| 84 #endif // BLIMP_CLIENT_FEATURE_IME_FEATURE_H_ | 85 #endif // BLIMP_CLIENT_FEATURE_IME_FEATURE_H_ |
| OLD | NEW |