| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/web_contents/touch_selection_controller_aura_client_im
pl.h" | 5 #include "content/browser/web_contents/touch_selection_controller_aura_client_im
pl.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/render_widget_host_impl.h" | 7 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // TouchSelectionControllerAuraClient implementation: | 30 // TouchSelectionControllerAuraClient implementation: |
| 31 | 31 |
| 32 void TouchSelectionControllerAuraClientImpl::MoveCaret( | 32 void TouchSelectionControllerAuraClientImpl::MoveCaret( |
| 33 const gfx::PointF& position) { | 33 const gfx::PointF& position) { |
| 34 RenderWidgetHostImpl* host = | 34 RenderWidgetHostImpl* host = |
| 35 RenderWidgetHostImpl::From(rwhva_->GetRenderWidgetHost()); | 35 RenderWidgetHostImpl::From(rwhva_->GetRenderWidgetHost()); |
| 36 host->MoveCaret(gfx::Point(position.x(), position.y())); | 36 host->MoveCaret(gfx::Point(position.x(), position.y())); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void TouchSelectionControllerAuraClientImpl::MoveRangeSelectionExtent( | 39 void TouchSelectionControllerAuraClientImpl::MoveRangeSelectionExtent( |
| 40 const gfx::PointF& extent) { | 40 const gfx::PointF& extent, |
| 41 ui::TextSelectionGranularity granularity) { |
| 41 RenderViewHost* rvh = RenderViewHost::From(rwhva_->GetRenderWidgetHost()); | 42 RenderViewHost* rvh = RenderViewHost::From(rwhva_->GetRenderWidgetHost()); |
| 42 WebContentsImpl* wc = | 43 WebContentsImpl* wc = |
| 43 static_cast<WebContentsImpl*>(WebContents::FromRenderViewHost(rvh)); | 44 static_cast<WebContentsImpl*>(WebContents::FromRenderViewHost(rvh)); |
| 44 wc->MoveRangeSelectionExtent(gfx::Point(extent.x(), extent.y())); | 45 wc->MoveRangeSelectionExtent(gfx::Point(extent.x(), extent.y()), |
| 46 granularity); |
| 45 } | 47 } |
| 46 | 48 |
| 47 void TouchSelectionControllerAuraClientImpl::SelectBetweenCoordinates( | 49 void TouchSelectionControllerAuraClientImpl::SelectBetweenCoordinates( |
| 48 const gfx::PointF& base, | 50 const gfx::PointF& base, |
| 49 const gfx::PointF& extent) { | 51 const gfx::PointF& extent) { |
| 50 RenderViewHost* rvh = RenderViewHost::From(rwhva_->GetRenderWidgetHost()); | 52 RenderViewHost* rvh = RenderViewHost::From(rwhva_->GetRenderWidgetHost()); |
| 51 WebContentsImpl* wc = | 53 WebContentsImpl* wc = |
| 52 static_cast<WebContentsImpl*>(WebContents::FromRenderViewHost(rvh)); | 54 static_cast<WebContentsImpl*>(WebContents::FromRenderViewHost(rvh)); |
| 53 wc->SelectRange(gfx::Point(base.x(), base.y()), | 55 wc->SelectRange(gfx::Point(base.x(), base.y()), |
| 54 gfx::Point(extent.x(), extent.y())); | 56 gfx::Point(extent.x(), extent.y())); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 ui::MENU_SOURCE_TOUCH_EDIT_MENU, | 121 ui::MENU_SOURCE_TOUCH_EDIT_MENU, |
| 120 gfx::Point(point.x(), point.y()))); | 122 gfx::Point(point.x(), point.y()))); |
| 121 } | 123 } |
| 122 | 124 |
| 123 gfx::Rect TouchSelectionControllerAuraClientImpl::ConvertRectToScreen( | 125 gfx::Rect TouchSelectionControllerAuraClientImpl::ConvertRectToScreen( |
| 124 const gfx::Rect& rect) const { | 126 const gfx::Rect& rect) const { |
| 125 return rwhva_->ConvertRectToScreen(rect); | 127 return rwhva_->ConvertRectToScreen(rect); |
| 126 } | 128 } |
| 127 | 129 |
| 128 } // namespace content | 130 } // namespace content |
| OLD | NEW |