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

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

Issue 11068010: Show selection handles around selected text. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed unnecessary 'virtual' Created 8 years, 2 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_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 3060c6e4657541450a7cb24e2cfde5a21b02de64..d2a40659be5e39b768697db4327b517b1d0656b6 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -21,6 +21,22 @@
namespace content {
+namespace {
+
+// TODO(pliard): http://crbug.com/142585. Remove this helper function and update
+// the clients to deal directly with WebKit::WebTextDirection.
+base::i18n::TextDirection ConvertTextDirection(WebKit::WebTextDirection dir) {
+ switch (dir) {
+ case WebKit::WebTextDirectionDefault: return base::i18n::UNKNOWN_DIRECTION;
+ case WebKit::WebTextDirectionLeftToRight: return base::i18n::LEFT_TO_RIGHT;
+ case WebKit::WebTextDirectionRightToLeft: return base::i18n::RIGHT_TO_LEFT;
+ }
+ NOTREACHED() << "Unsupported text direction " << dir;
+ return base::i18n::UNKNOWN_DIRECTION;
+}
+
+} // namespace
+
RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(
RenderWidgetHostImpl* widget_host,
ContentViewCoreImpl* content_view_core)
@@ -251,6 +267,20 @@ void RenderWidgetHostViewAndroid::SelectionChanged(const string16& text,
content_view_core_->OnSelectionChanged(utf8_selection);
}
+void RenderWidgetHostViewAndroid::SelectionBoundsChanged(
+ const gfx::Rect& start_rect,
+ WebKit::WebTextDirection start_direction,
+ const gfx::Rect& end_rect,
+ WebKit::WebTextDirection end_direction) {
+ if (content_view_core_) {
+ content_view_core_->OnSelectionBoundsChanged(
+ start_rect,
+ ConvertTextDirection(start_direction),
+ end_rect,
+ ConvertTextDirection(end_direction));
+ }
+}
+
BackingStore* RenderWidgetHostViewAndroid::AllocBackingStore(
const gfx::Size& size) {
NOTIMPLEMENTED();

Powered by Google App Engine
This is Rietveld 408576698