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

Unified Diff: services/keyboard_native/text_update_key.h

Issue 1247903003: Add spellcheck and word suggestion to the prediction service (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: format README and CHROMIUM.diff Created 5 years, 4 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/predictor.cc ('k') | services/keyboard_native/text_update_key.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/keyboard_native/text_update_key.h
diff --git a/services/keyboard_native/text_update_key.h b/services/keyboard_native/text_update_key.h
new file mode 100644
index 0000000000000000000000000000000000000000..9644146c02775a745910636fa140237640ef4a80
--- /dev/null
+++ b/services/keyboard_native/text_update_key.h
@@ -0,0 +1,48 @@
+// 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_NATIVE_TEXT_UPDATE_KEY_H_
+#define SERVICES_KEYBOARD_NATIVE_TEXT_UPDATE_KEY_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "services/keyboard_native/key_layout.h"
+
+class SkCanvas;
+class SkPaint;
+
+namespace gfx {
+class RectF;
+}
+
+namespace keyboard {
+class TextUpdateKey : public KeyLayout::Key {
+ public:
+ TextUpdateKey(std::string text,
+ base::Callback<void(const TextUpdateKey&)> touch_up_callback);
+
+ ~TextUpdateKey() override;
+
+ // Key implementation.
+ void Draw(SkCanvas* canvas,
+ const SkPaint& paint,
+ const gfx::RectF& rect) override;
+
+ const char* ToText() const override;
+
+ void OnTouchUp() override;
+
+ void ChangeText(std::string new_text);
+
+ private:
+ std::string text_;
+ base::Callback<void(const TextUpdateKey&)> touch_up_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(TextUpdateKey);
+};
+
+} // namespace keyboard
+
+#endif // SERVICES_KEYBOARD_NATIVE_TEXT_UPDATE_KEY_H_
« no previous file with comments | « services/keyboard_native/predictor.cc ('k') | services/keyboard_native/text_update_key.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698