OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_KEYBOARD_NATIVE_TEXT_UPDATE_KEY_H_ |
| 6 #define SERVICES_KEYBOARD_NATIVE_TEXT_UPDATE_KEY_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "services/keyboard_native/key_layout.h" |
| 12 |
| 13 class SkCanvas; |
| 14 class SkPaint; |
| 15 |
| 16 namespace gfx { |
| 17 class RectF; |
| 18 } |
| 19 |
| 20 namespace keyboard { |
| 21 class TextUpdateKey : public KeyLayout::Key { |
| 22 public: |
| 23 TextUpdateKey(std::string text, |
| 24 base::Callback<void(const TextUpdateKey&)> touch_up_callback); |
| 25 |
| 26 ~TextUpdateKey() override; |
| 27 |
| 28 // Key implementation. |
| 29 void Draw(SkCanvas* canvas, |
| 30 const SkPaint& paint, |
| 31 const gfx::RectF& rect) override; |
| 32 |
| 33 const char* ToText() const override; |
| 34 |
| 35 void OnTouchUp() override; |
| 36 |
| 37 void ChangeText(std::string new_text); |
| 38 |
| 39 private: |
| 40 std::string text_; |
| 41 base::Callback<void(const TextUpdateKey&)> touch_up_callback_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(TextUpdateKey); |
| 44 }; |
| 45 |
| 46 } // namespace keyboard |
| 47 |
| 48 #endif // SERVICES_KEYBOARD_NATIVE_TEXT_UPDATE_KEY_H_ |
OLD | NEW |