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

Unified Diff: services/keyboard/linux/keyboard_service_impl.h

Issue 1453823005: Implement Linux IME support (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Avoid modifying NativeViewport Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: services/keyboard/linux/keyboard_service_impl.h
diff --git a/services/keyboard/linux/keyboard_service_impl.h b/services/keyboard/linux/keyboard_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3108a9ae5975e8ca7ef034a0208820473c2b34e
--- /dev/null
+++ b/services/keyboard/linux/keyboard_service_impl.h
@@ -0,0 +1,51 @@
+// Copyright 2015 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 SERVICES_KEYBOARD_LINUX_KEYBOARD_SERVICE_IMPL_H_
+#define SERVICES_KEYBOARD_LINUX_KEYBOARD_SERVICE_IMPL_H_
+
+#include "base/macros.h"
+#include "mojo/public/cpp/application/interface_factory.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "mojo/public/interfaces/application/shell.mojom.h"
+#include "mojo/services/keyboard/interfaces/keyboard.mojom.h"
+#include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h"
+
+namespace keyboard {
+
+class LinuxKeyboardServiceImpl : public keyboard::KeyboardService,
+ public mojo::NativeViewportEventDispatcher {
+ public:
+ LinuxKeyboardServiceImpl(
+ mojo::InterfaceRequest<keyboard::KeyboardService> request,
+ mojo::InterfaceRequest<NativeViewportEventDispatcher> dispatcher);
+ ~LinuxKeyboardServiceImpl() override;
+
+ // |KeyboardService| overrides:
+ void Show(keyboard::KeyboardClientPtr client,
+ keyboard::KeyboardType type) override;
+ void ShowByRequest() override;
+ void Hide() override;
+ void SetText(const mojo::String& text) override;
+ void SetSelection(int32_t start, int32_t end) override;
+
+ // |NativeViewportEventDispatcher| overrides:
+ void OnEvent(mojo::EventPtr event,
+ const mojo::Callback<void()>& callback) override;
jamesr 2015/11/20 00:09:02 FYI the C++ code generator produces a typedef for
Kris 2015/11/20 01:37:35 Done.
+
+ private:
+ mojo::Shell* shell_;
+ mojo::ApplicationConnection* connection_;
jamesr 2015/11/20 00:09:02 these two members appear unused, delete
Kris 2015/11/20 01:37:35 Done.
+ mojo::StrongBinding<keyboard::KeyboardService> binding_;
jamesr 2015/11/20 00:09:02 i think you should put the StrongBinding<> last in
Kris 2015/11/20 01:37:35 Done.
+ mojo::Binding<mojo::NativeViewportEventDispatcher> event_dispatcher_binding_;
+
+ keyboard::KeyboardClientPtr client_;
+ std::string text_;
+
+ DISALLOW_COPY_AND_ASSIGN(LinuxKeyboardServiceImpl);
+};
+
+} // namespace keyboard
+
+#endif /* defined(SERVICES_KEYBOARD_LINUX_KEYBOARD_SERVICE_IMPL_H_) */
jamesr 2015/11/20 00:09:02 #endif // SERVICES_... we basically never use /*
Kris 2015/11/20 01:37:35 Done.

Powered by Google App Engine
This is Rietveld 408576698