Chromium Code Reviews| Index: services/keyboard_native/key_layout.h |
| diff --git a/services/keyboard_native/key_layout.h b/services/keyboard_native/key_layout.h |
| index d55e50f44c27b769ffcfa2d01f61c4f0c6f8107c..3ab5613a56f035f67c0a094f176810b60716212b 100644 |
| --- a/services/keyboard_native/key_layout.h |
| +++ b/services/keyboard_native/key_layout.h |
| @@ -12,7 +12,10 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "mojo/public/cpp/bindings/callback.h" |
| #include "mojo/services/geometry/public/interfaces/geometry.mojom.h" |
| +#include "mojo/tools/embed/data.h" |
| #include "third_party/skia/include/core/SkCanvas.h" |
| +#include "third_party/skia/include/core/SkImageDecoder.h" |
| +#include "third_party/skia/include/core/SkStream.h" |
| #include "ui/gfx/geometry/point.h" |
| #include "ui/gfx/geometry/rect.h" |
| @@ -80,6 +83,21 @@ class KeyLayout { |
| DISALLOW_COPY_AND_ASSIGN(TextKey); |
| }; |
| + // An implementation of Key that draws itself as an image. |
| + class ImageKey : public TextKey { |
|
jamesr
2015/05/27 23:30:31
why does this inherit from TextKey? inheriting fro
APW
2015/05/28 17:54:25
Done.
|
| + public: |
| + ImageKey(const char* text, |
| + base::Callback<void(const TextKey&)> touch_up_callback, |
| + const mojo::embed::Data& data); |
| + ~ImageKey() override; |
| + void Draw(SkCanvas* canvas, SkPaint paint, const gfx::RectF& rect) override; |
| + |
| + private: |
| + SkBitmap bitmap_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ImageKey); |
| + }; |
| + |
| // initializes the *_layout_ vectors. |
| void InitLayouts(); |