OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/touchui/touch_selection_controller_impl.h" | 5 #include "views/touchui/touch_selection_controller_impl.h" |
6 | 6 |
7 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
8 #include "ui/gfx/canvas_skia.h" | 8 #include "ui/gfx/canvas_skia.h" |
9 #include "ui/gfx/path.h" | 9 #include "ui/gfx/path.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 226 } |
227 | 227 |
228 void TouchSelectionControllerImpl::ConvertPointToClientView( | 228 void TouchSelectionControllerImpl::ConvertPointToClientView( |
229 SelectionHandleView* source, gfx::Point* point) { | 229 SelectionHandleView* source, gfx::Point* point) { |
230 View::ConvertPointToScreen(source, point); | 230 View::ConvertPointToScreen(source, point); |
231 gfx::Rect r = client_view_->GetWidget()->GetClientAreaScreenBounds(); | 231 gfx::Rect r = client_view_->GetWidget()->GetClientAreaScreenBounds(); |
232 point->SetPoint(point->x() - r.x(), point->y() - r.y()); | 232 point->SetPoint(point->x() - r.x(), point->y() - r.y()); |
233 View::ConvertPointFromWidget(client_view_, point); | 233 View::ConvertPointFromWidget(client_view_, point); |
234 } | 234 } |
235 | 235 |
| 236 gfx::Point TouchSelectionControllerImpl::GetSelectionHandle1Position() { |
| 237 return selection_handle_1_->GetScreenPosition(); |
| 238 } |
| 239 |
| 240 gfx::Point TouchSelectionControllerImpl::GetSelectionHandle2Position() { |
| 241 return selection_handle_2_->GetScreenPosition(); |
| 242 } |
| 243 |
| 244 bool TouchSelectionControllerImpl::IsSelectionHandle1Visible() { |
| 245 return selection_handle_1_->IsVisible(); |
| 246 } |
| 247 |
| 248 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { |
| 249 return selection_handle_2_->IsVisible(); |
| 250 } |
| 251 |
236 TouchSelectionController* TouchSelectionController::create( | 252 TouchSelectionController* TouchSelectionController::create( |
237 TouchSelectionClientView* client_view) { | 253 TouchSelectionClientView* client_view) { |
238 return new TouchSelectionControllerImpl(client_view); | 254 return new TouchSelectionControllerImpl(client_view); |
239 } | 255 } |
240 | 256 |
241 } // namespace views | 257 } // namespace views |
OLD | NEW |