| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 start_edge_bottom.Scale(viewportToDIPScale); | 930 start_edge_bottom.Scale(viewportToDIPScale); |
| 931 end_edge_top.Scale(viewportToDIPScale); | 931 end_edge_top.Scale(viewportToDIPScale); |
| 932 end_edge_bottom.Scale(viewportToDIPScale); | 932 end_edge_bottom.Scale(viewportToDIPScale); |
| 933 | 933 |
| 934 selection.start.SetEdge(start_edge_top, start_edge_bottom); | 934 selection.start.SetEdge(start_edge_top, start_edge_bottom); |
| 935 selection.end.SetEdge(end_edge_top, end_edge_bottom); | 935 selection.end.SetEdge(end_edge_top, end_edge_bottom); |
| 936 } | 936 } |
| 937 | 937 |
| 938 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, | 938 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, |
| 939 std::move(frame)); | 939 std::move(frame)); |
| 940 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, | 940 selection_controller_->OnSelectionBoundsChanged(selection.start, |
| 941 selection.start, selection.end); | 941 selection.end); |
| 942 } | 942 } |
| 943 | 943 |
| 944 void RenderWidgetHostViewAura::ClearCompositorFrame() { | 944 void RenderWidgetHostViewAura::ClearCompositorFrame() { |
| 945 delegated_frame_host_->ClearDelegatedFrame(); | 945 delegated_frame_host_->ClearDelegatedFrame(); |
| 946 } | 946 } |
| 947 | 947 |
| 948 void RenderWidgetHostViewAura::DidStopFlinging() { | 948 void RenderWidgetHostViewAura::DidStopFlinging() { |
| 949 selection_controller_client_->OnScrollCompleted(); | 949 selection_controller_client_->OnScrollCompleted(); |
| 950 } | 950 } |
| 951 | 951 |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 target_host->Send(new InputMsg_SetEditCommandsForNextKeyEvent( | 2170 target_host->Send(new InputMsg_SetEditCommandsForNextKeyEvent( |
| 2171 target_host->GetRoutingID(), edit_commands)); | 2171 target_host->GetRoutingID(), edit_commands)); |
| 2172 target_host->ForwardKeyboardEvent(event); | 2172 target_host->ForwardKeyboardEvent(event); |
| 2173 return; | 2173 return; |
| 2174 } | 2174 } |
| 2175 #endif | 2175 #endif |
| 2176 | 2176 |
| 2177 target_host->ForwardKeyboardEvent(event); | 2177 target_host->ForwardKeyboardEvent(event); |
| 2178 } | 2178 } |
| 2179 | 2179 |
| 2180 void RenderWidgetHostViewAura::SelectionUpdated( | |
| 2181 bool is_editable, | |
| 2182 bool is_empty_text_form_control, | |
| 2183 const gfx::SelectionBound& start, | |
| 2184 const gfx::SelectionBound& end) { | |
| 2185 selection_controller_->OnSelectionEditable(is_editable); | |
| 2186 selection_controller_->OnSelectionEmpty(is_empty_text_form_control); | |
| 2187 selection_controller_->OnSelectionBoundsChanged(start, end); | |
| 2188 } | |
| 2189 | |
| 2190 void RenderWidgetHostViewAura::CreateSelectionController() { | 2180 void RenderWidgetHostViewAura::CreateSelectionController() { |
| 2191 ui::TouchSelectionController::Config tsc_config; | 2181 ui::TouchSelectionController::Config tsc_config; |
| 2192 tsc_config.max_tap_duration = base::TimeDelta::FromMilliseconds( | 2182 tsc_config.max_tap_duration = base::TimeDelta::FromMilliseconds( |
| 2193 ui::GestureConfiguration::GetInstance()->long_press_time_in_ms()); | 2183 ui::GestureConfiguration::GetInstance()->long_press_time_in_ms()); |
| 2194 tsc_config.tap_slop = ui::GestureConfiguration::GetInstance() | 2184 tsc_config.tap_slop = ui::GestureConfiguration::GetInstance() |
| 2195 ->max_touch_move_in_pixels_for_click(); | 2185 ->max_touch_move_in_pixels_for_click(); |
| 2196 tsc_config.enable_longpress_drag_selection = false; | 2186 tsc_config.enable_longpress_drag_selection = false; |
| 2197 selection_controller_.reset(new ui::TouchSelectionController( | 2187 selection_controller_.reset(new ui::TouchSelectionController( |
| 2198 selection_controller_client_.get(), tsc_config)); | 2188 selection_controller_client_.get(), tsc_config)); |
| 2199 } | 2189 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2387 | 2377 |
| 2388 void RenderWidgetHostViewAura::SetPopupChild( | 2378 void RenderWidgetHostViewAura::SetPopupChild( |
| 2389 RenderWidgetHostViewAura* popup_child_host_view) { | 2379 RenderWidgetHostViewAura* popup_child_host_view) { |
| 2390 popup_child_host_view_ = popup_child_host_view; | 2380 popup_child_host_view_ = popup_child_host_view; |
| 2391 event_handler_->SetPopupChild( | 2381 event_handler_->SetPopupChild( |
| 2392 popup_child_host_view, | 2382 popup_child_host_view, |
| 2393 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); | 2383 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); |
| 2394 } | 2384 } |
| 2395 | 2385 |
| 2396 } // namespace content | 2386 } // namespace content |
| OLD | NEW |