Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BLIMP_CLIENT_FEATURE_WEB_INPUT_FEATURE_H_ | |
| 6 #define BLIMP_CLIENT_FEATURE_WEB_INPUT_FEATURE_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "blimp/client/blimp_client_export.h" | |
| 13 #include "blimp/net/blimp_message_processor.h" | |
| 14 | |
| 15 namespace blimp { | |
| 16 namespace client { | |
| 17 | |
| 18 // Handles all incoming and outgoing protobuf messages for text input | |
| 19 // of type BlimpMessage::IME. The handling of the message is delegated to the | |
| 20 // floating WebInputBox. | |
|
nyquist
2016/03/10 00:57:13
I guess WebInputbox isn't know by this class, so m
shaktisahu
2016/03/15 23:44:13
Done.
| |
| 21 class BLIMP_CLIENT_EXPORT WebInputFeature : public BlimpMessageProcessor { | |
|
nyquist
2016/03/10 00:57:13
Should there be a test for this class? It doesn't
| |
| 22 public: | |
| 23 // A delegate to be notified of text input events. | |
| 24 class WebInputFeatureDelegate { | |
| 25 public: | |
| 26 virtual void OnImeRequested(bool show, | |
|
David Trainor- moved to gerrit
2016/03/14 17:59:41
Javadoc. Should we pull hide out to another metho
shaktisahu
2016/03/15 23:44:13
Done.
| |
| 27 int input_type, | |
| 28 const std::string& text) = 0; | |
| 29 }; | |
| 30 | |
| 31 WebInputFeature(); | |
|
Khushal
2016/03/10 07:54:10
I think the WebInputFeature should be like the com
| |
| 32 ~WebInputFeature() override; | |
| 33 | |
| 34 // Set the BlimpMessageProcessor that will be used to send BlimpMessage::IME | |
| 35 // messages to the engine. | |
| 36 void set_outgoing_message_processor( | |
| 37 scoped_ptr<BlimpMessageProcessor> processor); | |
| 38 | |
| 39 // Sets a WebInputFeatureDelegate to be notified of all text input messages. | |
| 40 void SetDelegate(WebInputFeatureDelegate* delegate); | |
| 41 | |
| 42 // Sends text from Ime to the blimp engine. | |
|
nyquist
2016/03/10 00:57:13
Nit: 'IME'
shaktisahu
2016/03/15 23:44:13
Done.
| |
| 43 void SendImeTextToEngine(const std::string& text); | |
| 44 | |
| 45 private: | |
| 46 // BlimpMessageProcessor implementation. | |
| 47 void ProcessMessage(scoped_ptr<BlimpMessage> message, | |
| 48 const net::CompletionCallback& callback) override; | |
| 49 | |
| 50 WebInputFeatureDelegate* delegate_; | |
| 51 | |
| 52 // Used to send BlimpMessage::IME messages to the engine. | |
| 53 scoped_ptr<BlimpMessageProcessor> outgoing_message_processor_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(WebInputFeature); | |
| 56 }; | |
| 57 | |
| 58 } // namespace client | |
| 59 } // namespace blimp | |
| 60 | |
| 61 #endif // BLIMP_CLIENT_FEATURE_WEB_INPUT_FEATURE_H_ | |
| OLD | NEW |