OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer_host/input/touch_selection_controller_client_
aura.h" | 5 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 8 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
9 #include "content/browser/renderer_host/render_widget_host_impl.h" | 9 #include "content/browser/renderer_host/render_widget_host_impl.h" |
10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
11 #include "content/common/view_messages.h" | 11 #include "content/common/frame_messages.h" |
12 #include "content/public/browser/render_view_host.h" | 12 #include "content/public/browser/render_view_host.h" |
13 #include "content/public/common/context_menu_params.h" | 13 #include "content/public/common/context_menu_params.h" |
14 #include "ui/aura/client/cursor_client.h" | 14 #include "ui/aura/client/cursor_client.h" |
15 #include "ui/aura/client/screen_position_client.h" | 15 #include "ui/aura/client/screen_position_client.h" |
16 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
18 #include "ui/base/clipboard/clipboard.h" | 18 #include "ui/base/clipboard/clipboard.h" |
19 #include "ui/gfx/geometry/point_conversions.h" | 19 #include "ui/gfx/geometry/point_conversions.h" |
20 #include "ui/gfx/geometry/size_conversions.h" | 20 #include "ui/gfx/geometry/size_conversions.h" |
21 #include "ui/strings/grit/ui_strings.h" | 21 #include "ui/strings/grit/ui_strings.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 } | 456 } |
457 } | 457 } |
458 | 458 |
459 void TouchSelectionControllerClientAura::RunContextMenu() { | 459 void TouchSelectionControllerClientAura::RunContextMenu() { |
460 gfx::RectF anchor_rect = | 460 gfx::RectF anchor_rect = |
461 rwhva_->selection_controller()->GetRectBetweenBounds(); | 461 rwhva_->selection_controller()->GetRectBetweenBounds(); |
462 gfx::PointF anchor_point = | 462 gfx::PointF anchor_point = |
463 gfx::PointF(anchor_rect.CenterPoint().x(), anchor_rect.y()); | 463 gfx::PointF(anchor_rect.CenterPoint().x(), anchor_rect.y()); |
464 RenderWidgetHostImpl* host = | 464 RenderWidgetHostImpl* host = |
465 RenderWidgetHostImpl::From(rwhva_->GetRenderWidgetHost()); | 465 RenderWidgetHostImpl::From(rwhva_->GetRenderWidgetHost()); |
466 host->Send(new ViewMsg_ShowContextMenu(host->GetRoutingID(), | 466 host->Send(new FrameMsg_ShowContextMenu(host->GetRoutingID(), |
467 ui::MENU_SOURCE_TOUCH_EDIT_MENU, | 467 ui::MENU_SOURCE_TOUCH_EDIT_MENU, |
468 gfx::ToRoundedPoint(anchor_point))); | 468 gfx::ToRoundedPoint(anchor_point))); |
469 | 469 |
470 // Hide selection handles after getting rect-between-bounds from touch | 470 // Hide selection handles after getting rect-between-bounds from touch |
471 // selection controller; otherwise, rect would be empty and the above | 471 // selection controller; otherwise, rect would be empty and the above |
472 // calculations would be invalid. | 472 // calculations would be invalid. |
473 rwhva_->selection_controller()->HideAndDisallowShowingAutomatically(); | 473 rwhva_->selection_controller()->HideAndDisallowShowingAutomatically(); |
474 } | 474 } |
475 | 475 |
476 } // namespace content | 476 } // namespace content |
OLD | NEW |