Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2664253002: Revert "Blink handle selection handle visibility" (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 selection_controller_->OnSelectionBoundsChanged(selection.start, 936 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control,
937 selection.end); 937 selection.start, 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 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 } 2230 }
2231 2231
2232 target_host->ForwardKeyboardEventWithCommands(event, &edit_commands); 2232 target_host->ForwardKeyboardEventWithCommands(event, &edit_commands);
2233 return; 2233 return;
2234 } 2234 }
2235 #endif 2235 #endif
2236 2236
2237 target_host->ForwardKeyboardEvent(event); 2237 target_host->ForwardKeyboardEvent(event);
2238 } 2238 }
2239 2239
2240 void RenderWidgetHostViewAura::SelectionUpdated(
2241 bool is_editable,
2242 bool is_empty_text_form_control,
2243 const gfx::SelectionBound& start,
2244 const gfx::SelectionBound& end) {
2245 selection_controller_->OnSelectionEditable(is_editable);
2246 selection_controller_->OnSelectionEmpty(is_empty_text_form_control);
2247 selection_controller_->OnSelectionBoundsChanged(start, end);
2248 }
2249
2240 void RenderWidgetHostViewAura::CreateSelectionController() { 2250 void RenderWidgetHostViewAura::CreateSelectionController() {
2241 ui::TouchSelectionController::Config tsc_config; 2251 ui::TouchSelectionController::Config tsc_config;
2242 tsc_config.max_tap_duration = base::TimeDelta::FromMilliseconds( 2252 tsc_config.max_tap_duration = base::TimeDelta::FromMilliseconds(
2243 ui::GestureConfiguration::GetInstance()->long_press_time_in_ms()); 2253 ui::GestureConfiguration::GetInstance()->long_press_time_in_ms());
2244 tsc_config.tap_slop = ui::GestureConfiguration::GetInstance() 2254 tsc_config.tap_slop = ui::GestureConfiguration::GetInstance()
2245 ->max_touch_move_in_pixels_for_click(); 2255 ->max_touch_move_in_pixels_for_click();
2246 tsc_config.enable_longpress_drag_selection = false; 2256 tsc_config.enable_longpress_drag_selection = false;
2247 selection_controller_.reset(new ui::TouchSelectionController( 2257 selection_controller_.reset(new ui::TouchSelectionController(
2248 selection_controller_client_.get(), tsc_config)); 2258 selection_controller_client_.get(), tsc_config));
2249 } 2259 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 2375
2366 void RenderWidgetHostViewAura::SetPopupChild( 2376 void RenderWidgetHostViewAura::SetPopupChild(
2367 RenderWidgetHostViewAura* popup_child_host_view) { 2377 RenderWidgetHostViewAura* popup_child_host_view) {
2368 popup_child_host_view_ = popup_child_host_view; 2378 popup_child_host_view_ = popup_child_host_view;
2369 event_handler_->SetPopupChild( 2379 event_handler_->SetPopupChild(
2370 popup_child_host_view, 2380 popup_child_host_view,
2371 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); 2381 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr);
2372 } 2382 }
2373 2383
2374 } // namespace content 2384 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698