| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SERVICES_KEYBOARD_NATIVE_KEYBOARD_SERVICE_IMPL_H_ | 5 #ifndef SERVICES_KEYBOARD_NATIVE_KEYBOARD_SERVICE_IMPL_H_ |
| 6 #define SERVICES_KEYBOARD_NATIVE_KEYBOARD_SERVICE_IMPL_H_ | 6 #define SERVICES_KEYBOARD_NATIVE_KEYBOARD_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/interface_request.h" | 9 #include "mojo/public/cpp/bindings/interface_request.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" | 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 11 #include "mojo/services/keyboard/public/interfaces/keyboard.mojom.h" | 11 #include "mojo/services/keyboard/public/interfaces/keyboard.mojom.h" |
| 12 #include "services/keyboard_native/view_observer_delegate.h" | 12 #include "services/keyboard_native/view_observer_delegate.h" |
| 13 | 13 |
| 14 namespace keyboard { | 14 namespace keyboard { |
| 15 | 15 |
| 16 class KeyboardServiceImpl : public KeyboardService { | 16 class KeyboardServiceImpl : public KeyboardService { |
| 17 public: | 17 public: |
| 18 explicit KeyboardServiceImpl(mojo::InterfaceRequest<KeyboardService> request); | 18 explicit KeyboardServiceImpl(mojo::InterfaceRequest<KeyboardService> request); |
| 19 ~KeyboardServiceImpl() override; | 19 ~KeyboardServiceImpl() override; |
| 20 | 20 |
| 21 // KeyboardService implementation. | 21 // KeyboardService implementation. |
| 22 void Show(KeyboardClientPtr client, KeyboardType type) override; | 22 void Show(KeyboardClientPtr client, KeyboardType type) override; |
| 23 void ShowByRequest() override; | 23 void ShowByRequest() override; |
| 24 void Hide() override; | 24 void Hide() override; |
| 25 void SetText(const mojo::String& text) override; |
| 26 void SetSelection(int32_t start, int32_t end) override; |
| 25 | 27 |
| 26 void OnKey(const char* key); | 28 void OnKey(const char* key); |
| 27 void OnDelete(); | 29 void OnDelete(); |
| 28 | 30 |
| 29 private: | 31 private: |
| 30 mojo::StrongBinding<KeyboardService> strong_binding_; | 32 mojo::StrongBinding<KeyboardService> strong_binding_; |
| 31 KeyboardClientPtr client_; | 33 KeyboardClientPtr client_; |
| 32 | 34 |
| 33 DISALLOW_COPY_AND_ASSIGN(KeyboardServiceImpl); | 35 DISALLOW_COPY_AND_ASSIGN(KeyboardServiceImpl); |
| 34 }; | 36 }; |
| 35 | 37 |
| 36 } // namespace keyboard | 38 } // namespace keyboard |
| 37 | 39 |
| 38 #endif // SERVICES_KEYBOARD_NATIVE_KEYBOARD_SERVICE_IMPL_H_ | 40 #endif // SERVICES_KEYBOARD_NATIVE_KEYBOARD_SERVICE_IMPL_H_ |
| OLD | NEW |