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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 end_edge_bottom.Scale(viewportToDIPScale); | 926 end_edge_bottom.Scale(viewportToDIPScale); |
927 | 927 |
928 selection.start.SetEdge(start_edge_top, start_edge_bottom); | 928 selection.start.SetEdge(start_edge_top, start_edge_bottom); |
929 selection.end.SetEdge(end_edge_top, end_edge_bottom); | 929 selection.end.SetEdge(end_edge_top, end_edge_bottom); |
930 } | 930 } |
931 | 931 |
932 if (delegated_frame_host_) { | 932 if (delegated_frame_host_) { |
933 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, | 933 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, |
934 std::move(frame)); | 934 std::move(frame)); |
935 } | 935 } |
936 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, | 936 selection_controller_->OnSelectionBoundsChanged(selection.start, |
937 selection.start, selection.end); | 937 selection.end); |
938 } | 938 } |
939 | 939 |
940 void RenderWidgetHostViewAura::ClearCompositorFrame() { | 940 void RenderWidgetHostViewAura::ClearCompositorFrame() { |
941 if (delegated_frame_host_) | 941 if (delegated_frame_host_) |
942 delegated_frame_host_->ClearDelegatedFrame(); | 942 delegated_frame_host_->ClearDelegatedFrame(); |
943 } | 943 } |
944 | 944 |
945 void RenderWidgetHostViewAura::DidStopFlinging() { | 945 void RenderWidgetHostViewAura::DidStopFlinging() { |
946 selection_controller_client_->OnScrollCompleted(); | 946 selection_controller_client_->OnScrollCompleted(); |
947 } | 947 } |
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2236 target_host->Send(new InputMsg_SetEditCommandsForNextKeyEvent( | 2236 target_host->Send(new InputMsg_SetEditCommandsForNextKeyEvent( |
2237 target_host->GetRoutingID(), edit_commands)); | 2237 target_host->GetRoutingID(), edit_commands)); |
2238 target_host->ForwardKeyboardEvent(event); | 2238 target_host->ForwardKeyboardEvent(event); |
2239 return; | 2239 return; |
2240 } | 2240 } |
2241 #endif | 2241 #endif |
2242 | 2242 |
2243 target_host->ForwardKeyboardEvent(event); | 2243 target_host->ForwardKeyboardEvent(event); |
2244 } | 2244 } |
2245 | 2245 |
2246 void RenderWidgetHostViewAura::SelectionUpdated( | |
2247 bool is_editable, | |
2248 bool is_empty_text_form_control, | |
2249 const gfx::SelectionBound& start, | |
2250 const gfx::SelectionBound& end) { | |
2251 selection_controller_->OnSelectionEditable(is_editable); | |
2252 selection_controller_->OnSelectionEmpty(is_empty_text_form_control); | |
2253 selection_controller_->OnSelectionBoundsChanged(start, end); | |
2254 } | |
2255 | |
2256 void RenderWidgetHostViewAura::CreateSelectionController() { | 2246 void RenderWidgetHostViewAura::CreateSelectionController() { |
2257 ui::TouchSelectionController::Config tsc_config; | 2247 ui::TouchSelectionController::Config tsc_config; |
2258 tsc_config.max_tap_duration = base::TimeDelta::FromMilliseconds( | 2248 tsc_config.max_tap_duration = base::TimeDelta::FromMilliseconds( |
2259 ui::GestureConfiguration::GetInstance()->long_press_time_in_ms()); | 2249 ui::GestureConfiguration::GetInstance()->long_press_time_in_ms()); |
2260 tsc_config.tap_slop = ui::GestureConfiguration::GetInstance() | 2250 tsc_config.tap_slop = ui::GestureConfiguration::GetInstance() |
2261 ->max_touch_move_in_pixels_for_click(); | 2251 ->max_touch_move_in_pixels_for_click(); |
2262 tsc_config.enable_longpress_drag_selection = false; | 2252 tsc_config.enable_longpress_drag_selection = false; |
2263 selection_controller_.reset(new ui::TouchSelectionController( | 2253 selection_controller_.reset(new ui::TouchSelectionController( |
2264 selection_controller_client_.get(), tsc_config)); | 2254 selection_controller_client_.get(), tsc_config)); |
2265 } | 2255 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2381 | 2371 |
2382 void RenderWidgetHostViewAura::SetPopupChild( | 2372 void RenderWidgetHostViewAura::SetPopupChild( |
2383 RenderWidgetHostViewAura* popup_child_host_view) { | 2373 RenderWidgetHostViewAura* popup_child_host_view) { |
2384 popup_child_host_view_ = popup_child_host_view; | 2374 popup_child_host_view_ = popup_child_host_view; |
2385 event_handler_->SetPopupChild( | 2375 event_handler_->SetPopupChild( |
2386 popup_child_host_view, | 2376 popup_child_host_view, |
2387 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); | 2377 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); |
2388 } | 2378 } |
2389 | 2379 |
2390 } // namespace content | 2380 } // namespace content |
OLD | NEW |