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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2694543002: [refactor] Cleanup IME State in RenderWidgetHostViewMac which is already tracked by TextInputManager (Closed)
Patch Set: Fixed another compile error for Android test Created 3 years, 10 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/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 010e0590b5352cbba30cf88ac2cd54b7284a91a5..a600f838d59b88dcfa6db2d14a4c44a51c1fb0a8 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1337,8 +1337,8 @@ bool RenderWidgetHostViewAura::GetTextRange(gfx::Range* range) const {
if (!selection)
return false;
- range->set_start(selection->offset);
- range->set_end(selection->offset + selection->text.length());
+ range->set_start(selection->offset());
+ range->set_end(selection->offset() + selection->text().length());
return true;
}
@@ -1358,8 +1358,8 @@ bool RenderWidgetHostViewAura::GetSelectionRange(gfx::Range* range) const {
if (!selection)
return false;
- range->set_start(selection->range.start());
- range->set_end(selection->range.end());
+ range->set_start(selection->range().start());
+ range->set_end(selection->range().end());
return true;
}
@@ -1386,8 +1386,8 @@ bool RenderWidgetHostViewAura::GetTextFromRange(
if (!selection)
return false;
- gfx::Range selection_text_range(selection->offset,
- selection->offset + selection->text.length());
+ gfx::Range selection_text_range(
+ selection->offset(), selection->offset() + selection->text().length());
if (!selection_text_range.Contains(range)) {
text->clear();
@@ -1395,10 +1395,10 @@ bool RenderWidgetHostViewAura::GetTextFromRange(
}
if (selection_text_range.EqualsIgnoringDirection(range)) {
// Avoid calling substr whose performance is low.
- *text = selection->text;
+ *text = selection->text();
} else {
- *text = selection->text.substr(range.GetMin() - selection->offset,
- range.length());
+ *text = selection->text().substr(range.GetMin() - selection->offset(),
+ range.length());
}
return true;
}
@@ -2356,14 +2356,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
if (!focused_view)
return;
- base::string16 selected_text;
- if (GetTextInputManager()
- ->GetTextSelection(focused_view)
- ->GetSelectedText(&selected_text) &&
- selected_text.length()) {
+ const TextInputManager::TextSelection* selection =
+ GetTextInputManager()->GetTextSelection(focused_view);
+ if (selection->selected_text().length()) {
// Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard.
ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_SELECTION);
- clipboard_writer.WriteText(selected_text);
+ clipboard_writer.WriteText(selection->selected_text());
}
#endif // defined(USE_X11) && !defined(OS_CHROMEOS)
}

Powered by Google App Engine
This is Rietveld 408576698