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

Unified Diff: services/keyboard_native/key_layout.h

Issue 1149293002: Add the ability for keys to be drawn as an image. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Addressed nits Created 5 years, 7 months 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
« no previous file with comments | « services/keyboard_native/BUILD.gn ('k') | services/keyboard_native/key_layout.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..09f567086b3b239e676fe53bdaca38c3b5b374f6 100644
--- a/services/keyboard_native/key_layout.h
+++ b/services/keyboard_native/key_layout.h
@@ -10,11 +10,15 @@
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
-#include "mojo/public/cpp/bindings/callback.h"
#include "mojo/services/geometry/public/interfaces/geometry.mojom.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "ui/gfx/geometry/point.h"
-#include "ui/gfx/geometry/rect.h"
+
+class SkCanvas;
+class SkPaint;
+
+namespace gfx {
+class RectF;
+class Point;
+}
namespace keyboard {
@@ -29,7 +33,7 @@ class KeyLayout {
// Draws the Key to the SkCanvas with the given SkPaint to the given Rect.
virtual void Draw(SkCanvas* canvas,
- SkPaint paint,
+ const SkPaint& paint,
const gfx::RectF& rect) = 0;
// Converts the Key to its text representation.
@@ -39,6 +43,8 @@ class KeyLayout {
virtual void OnTouchUp() = 0;
};
+ class TextKey;
+
KeyLayout();
~KeyLayout();
@@ -63,23 +69,6 @@ class KeyLayout {
void OnTouchUp(const gfx::Point& touch_up);
private:
- // An implementation of Key that draws itself as ASCII text.
- class TextKey : public Key {
- public:
- TextKey(const char* text,
- base::Callback<void(const TextKey&)> touch_up_callback);
- ~TextKey() override;
- void Draw(SkCanvas* canvas, SkPaint paint, const gfx::RectF& rect) override;
- const char* ToText() const override;
- void OnTouchUp() override;
-
- private:
- const char* text_;
- base::Callback<void(const TextKey&)> touch_up_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(TextKey);
- };
-
// initializes the *_layout_ vectors.
void InitLayouts();
« no previous file with comments | « services/keyboard_native/BUILD.gn ('k') | services/keyboard_native/key_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698