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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_views.cc

Issue 7570001: Implement touch selection for RWHVV. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: sync Created 9 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: chrome/browser/renderer_host/render_widget_host_view_views.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc
index 858547cf20c2eb50313eef8bbfd1e5a81c73d19c..95f5083eb3382ddad2025a39dad7879a91eb621e 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_views.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc
@@ -87,7 +87,9 @@ RenderWidgetHostViewViews::RenderWidgetHostViewViews(RenderWidgetHost* host)
visually_deemphasized_(false),
touch_event_(),
text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
- has_composition_text_(false) {
+ has_composition_text_(false),
+ ALLOW_THIS_IN_INITIALIZER_LIST(touch_selection_controller_(
+ views::TouchSelectionController::create(this))) {
set_focusable(true);
host_->SetView(this);
@@ -304,9 +306,13 @@ void RenderWidgetHostViewViews::SetTooltipText(const std::wstring& tip) {
}
void RenderWidgetHostViewViews::SelectionChanged(const std::string& text,
- const ui::Range& range) {
+ const ui::Range& range,
+ const gfx::Point& start,
+ const gfx::Point& end) {
// TODO(anicolao): deal with the clipboard without GTK
NOTIMPLEMENTED();
+ if (touch_selection_controller_.get())
+ touch_selection_controller_->SelectionChanged(start, end);
}
void RenderWidgetHostViewViews::ShowingContextMenu(bool showing) {
@@ -329,6 +335,34 @@ void RenderWidgetHostViewViews::SetVisuallyDeemphasized(
// TODO(anicolao)
}
+void RenderWidgetHostViewViews::SelectRect(const gfx::Point& start,
+ const gfx::Point& end) {
+ if (host_)
+ host_->Send(new ViewMsg_SelectRange(host_->routing_id(), start, end));
+}
+
+bool RenderWidgetHostViewViews::IsCommandIdChecked(int command_id) const {
+ // TODO(varunjain): implement this and other menu delegate methods.
+ NOTREACHED();
+ return true;
+}
+
+bool RenderWidgetHostViewViews::IsCommandIdEnabled(int command_id) const {
+ NOTREACHED();
+ return true;
+}
+
+bool RenderWidgetHostViewViews::GetAcceleratorForCommandId(
+ int command_id,
+ ui::Accelerator* accelerator) {
+ NOTREACHED();
+ return true;
+}
+
+void RenderWidgetHostViewViews::ExecuteCommand(int command_id) {
+ NOTREACHED();
+}
+
std::string RenderWidgetHostViewViews::GetClassName() const {
return kViewClassName;
}
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_views.h ('k') | content/browser/renderer_host/render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698