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

Unified Diff: content/browser/renderer_host/text_input_manager.h

Issue 2213503002: Tracking SelectionBounds for all RenderWidgets on the Browser Side (Mac) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a crash Created 4 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
Index: content/browser/renderer_host/text_input_manager.h
diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h
index b09ae5069420f5c96af8b022c118a5a5e52fc008..76265fecefc92bc07f33e24f9f53653c797e1cdf 100644
--- a/content/browser/renderer_host/text_input_manager.h
+++ b/content/browser/renderer_host/text_input_manager.h
@@ -97,9 +97,6 @@ class CONTENT_EXPORT TextInputManager {
// interpreted as a ui::TextInputType of ui::TEXT_INPUT_TYPE_NONE.
const TextInputState* GetTextInputState() const;
- // Returns the rect between selection bounds.
- gfx::Rect GetSelectionBoundsRect() const;
-
// Returns a vector of rects representing the character bounds.
const std::vector<gfx::Rect>* GetCompositionCharacterBounds() const;
@@ -109,6 +106,17 @@ class CONTENT_EXPORT TextInputManager {
const TextSelection* GetTextSelection(
RenderWidgetHostViewBase* view = nullptr) const;
+#if defined(USE_AURA)
+ // Returns the rect between selection bounds.
+ gfx::Rect GetSelectionBoundsRect() const;
+#elif defined(OS_MACOSX)
Charlie Reis 2016/08/04 18:44:51 Hmm, this seems unfortunate to need different sele
EhsanK 2016/08/04 23:53:02 There is more in the .cc file for each specific me
kenrb 2016/08/08 22:03:04 What if we just store (more or less) the raw conte
+ // Returns the first caret bound for the view corresponding to |widget|.
+ const gfx::Rect* GetCaretRect(RenderWidgetHostImpl* widget) const;
+
+ // Returns the first selection bound for the view corresponding to |widget|.
+ const gfx::Rect* GetFirstSelectionRect(RenderWidgetHostImpl* widget) const;
+#endif
+
// ---------------------------------------------------------------------------
// The following methods are called by RWHVs on the tab to update their IME-
// related state.
@@ -168,16 +176,24 @@ class CONTENT_EXPORT TextInputManager {
RenderWidgetHostViewBase* view);
private:
+#if !defined(OS_ANDROID)
// Text selection bounds.
struct SelectionRegion {
SelectionRegion();
SelectionRegion(const SelectionRegion& other);
-
+#if defined(USE_AURA)
// The begining of the selection region.
gfx::SelectionBound anchor;
// The end of the selection region (caret position).
gfx::SelectionBound focus;
+#else // OS_MACOSX
Charlie Reis 2016/08/04 18:44:51 Same here, and more so. This will be difficult to
EhsanK 2016/08/04 23:53:02 Let me think about this. Meanwhile, all suggestion
+ // The current caret bounds.
+ gfx::Rect caret_rect;
+ // The current first selection bounds.
+ gfx::Rect first_selection_rect;
+#endif // USE_AURA
};
+#endif
// Ccomposition range information.
struct CompositionRangeInfo {

Powered by Google App Engine
This is Rietveld 408576698