Chromium Code Reviews| Index: blimp/client/feature/web_input_feature.h |
| diff --git a/blimp/client/feature/web_input_feature.h b/blimp/client/feature/web_input_feature.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b75d2e78b52e91df3a0295a9d10e6fd69ca23eb4 |
| --- /dev/null |
| +++ b/blimp/client/feature/web_input_feature.h |
| @@ -0,0 +1,61 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BLIMP_CLIENT_FEATURE_WEB_INPUT_FEATURE_H_ |
| +#define BLIMP_CLIENT_FEATURE_WEB_INPUT_FEATURE_H_ |
| + |
| +#include <map> |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "blimp/client/blimp_client_export.h" |
| +#include "blimp/net/blimp_message_processor.h" |
| + |
| +namespace blimp { |
| +namespace client { |
| + |
| +// Handles all incoming and outgoing protobuf messages for text input |
| +// of type BlimpMessage::IME. The handling of the message is delegated to the |
| +// 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.
|
| +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
|
| + public: |
| + // A delegate to be notified of text input events. |
| + class WebInputFeatureDelegate { |
| + public: |
| + 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.
|
| + int input_type, |
| + const std::string& text) = 0; |
| + }; |
| + |
| + WebInputFeature(); |
|
Khushal
2016/03/10 07:54:10
I think the WebInputFeature should be like the com
|
| + ~WebInputFeature() override; |
| + |
| + // Set the BlimpMessageProcessor that will be used to send BlimpMessage::IME |
| + // messages to the engine. |
| + void set_outgoing_message_processor( |
| + scoped_ptr<BlimpMessageProcessor> processor); |
| + |
| + // Sets a WebInputFeatureDelegate to be notified of all text input messages. |
| + void SetDelegate(WebInputFeatureDelegate* delegate); |
| + |
| + // 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.
|
| + void SendImeTextToEngine(const std::string& text); |
| + |
| + private: |
| + // BlimpMessageProcessor implementation. |
| + void ProcessMessage(scoped_ptr<BlimpMessage> message, |
| + const net::CompletionCallback& callback) override; |
| + |
| + WebInputFeatureDelegate* delegate_; |
| + |
| + // Used to send BlimpMessage::IME messages to the engine. |
| + scoped_ptr<BlimpMessageProcessor> outgoing_message_processor_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebInputFeature); |
| +}; |
| + |
| +} // namespace client |
| +} // namespace blimp |
| + |
| +#endif // BLIMP_CLIENT_FEATURE_WEB_INPUT_FEATURE_H_ |