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

Unified Diff: content/public/test/text_input_test_utils.h

Issue 2132633002: Tracking composition range on the browser side (Aura) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing creis@'s comments and changing a test method Created 4 years, 5 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 | « content/browser/renderer_host/text_input_manager.cc ('k') | content/public/test/text_input_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/text_input_test_utils.h
diff --git a/content/public/test/text_input_test_utils.h b/content/public/test/text_input_test_utils.h
index f87e9fed0fd7b7fe0c04d4c44d51e78487515e38..97b1da1a76da600d20012d722a49a0c3db3c35b0 100644
--- a/content/public/test/text_input_test_utils.h
+++ b/content/public/test/text_input_test_utils.h
@@ -6,13 +6,24 @@
#define CONTENT_PUBLIC_TEST_TEXT_INPUT_TEST_UTILS_H_
#include <string>
+#include <vector>
#include "base/callback.h"
+#include "base/strings/string16.h"
#include "ui/base/ime/text_input_mode.h"
#include "ui/base/ime/text_input_type.h"
+namespace gfx {
+class Range;
+}
+
+namespace ui {
+struct CompositionUnderline;
+}
+
namespace content {
+class RenderWidgetHost;
class RenderWidgetHostView;
class RenderWidgetHostViewBase;
class WebContents;
@@ -38,6 +49,16 @@ size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents);
// given WebContents.
RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents);
+// This method will send an InputMsg_ImeSetComposition IPC with the provided
+// parameters to the |render_widget_host|.
+void SetCompositionForRenderWidgetHost(
+ RenderWidgetHost* render_widget_host,
+ const base::string16& text,
+ const std::vector<ui::CompositionUnderline>& underlines,
+ const gfx::Range& replacement_range,
+ int selection_start,
+ int selection_end);
+
// This class provides the necessary API for accessing the state of and also
// observing the TextInputManager for WebContents.
class TextInputManagerTester {
@@ -53,6 +74,10 @@ class TextInputManagerTester {
// on the TextInputManager which is being observed.
void SetOnSelectionBoundsChangedCallback(const base::Closure& callback);
+ // Sets a callback which is invoked when a RWHV calls
+ // ImeCompositionRangeChanged on the TextInputManager that is being observed.
+ void SetOnImeCompositionRangeChangedCallback(const base::Closure& callback);
+
// Returns true if there is a focused <input> and populates |type| with
// |TextInputState.type| of the TextInputManager.
bool GetTextInputType(ui::TextInputType* type);
« no previous file with comments | « content/browser/renderer_host/text_input_manager.cc ('k') | content/public/test/text_input_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698