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

Unified Diff: ui/base/ime/android/cursor_anchor_info_controller.h

Issue 643193003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (C++ version) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Send ImeCompositionRangeChanged only when necessary Created 5 years, 11 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
Index: ui/base/ime/android/cursor_anchor_info_controller.h
diff --git a/ui/base/ime/android/cursor_anchor_info_controller.h b/ui/base/ime/android/cursor_anchor_info_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6000354d533b729ce93a4a704ead1313386642d
--- /dev/null
+++ b/ui/base/ime/android/cursor_anchor_info_controller.h
@@ -0,0 +1,69 @@
+// Copyright (c) 2014 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 UI_BASE_IME_ANDROID_CURAOR_ANCHOR_INFO_CONTROLLER_H_
+#define UI_BASE_IME_ANDROID_CURAOR_ANCHOR_INFO_CONTROLLER_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/strings/string16.h"
+#include "ui/base/ui_base_export.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/vector2d.h"
+#include "ui/gfx/geometry/vector2d_f.h"
+#include "ui/gfx/range/range.h"
+
+namespace cc {
+class CompositorFrameMetadata;
+}
+
+namespace ui {
+
+class CursorAnchorInfoBuilder;
+class CursorAnchorInfoSender;
+
+class UI_BASE_EXPORT CursorAnchorInfoController {
+ public:
+ // Defined in android.view.inputmethod.InputConnection.
+ enum Flags {
+ kCursorUpdateModeImmediate = 0x01,
+ kCursorUpdateModeMonitor = 0x02,
+ };
+
+ virtual ~CursorAnchorInfoController();
+
+ virtual void OnFocusedNodeChanged(bool is_editable_node) = 0;
+
+ virtual void OnTextInputStateChanged(
+ const base::string16& text,
+ const gfx::Range& selection_range,
+ const gfx::Range& composition_range) = 0;
+
+ virtual void OnCompositionRangeChanged(
+ const gfx::Range& range,
+ const std::vector<gfx::Rect>& character_bounds) = 0;
+
+ virtual void OnFrameMetadataUpdated(
+ const cc::CompositorFrameMetadata& frame_metadata,
+ const gfx::Vector2d& view_offset) = 0;
+
+ virtual bool OnRequestCursorUpdates(uint32 cursor_update_mode) = 0;
+
+ // Does not take ownership of |sender|.
+ static scoped_ptr<CursorAnchorInfoController> Create(
+ CursorAnchorInfoSender* sender);
+
+ static scoped_ptr<CursorAnchorInfoController> CreateForTest(
+ CursorAnchorInfoSender* sender,
+ scoped_ptr<CursorAnchorInfoBuilder> cursor_anchor_info_builder);
+
+ protected:
+ CursorAnchorInfoController();
+};
+
+} // namespace ui
+
+#endif // UI_BASE_IME_ANDROID_CURAOR_ANCHOR_INFO_CONTROLLER_H_
« no previous file with comments | « ui/base/ime/android/cursor_anchor_info_builder.cc ('k') | ui/base/ime/android/cursor_anchor_info_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698