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

Side by Side Diff: content/renderer/render_widget.cc

Issue 2863693003: Unify TouchAction classes (Closed)
Patch Set: Unfortunately doesn't work Created 3 years, 7 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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/feature_list.h" 13 #include "base/feature_list.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ptr_util.h" 16 #include "base/memory/ptr_util.h"
17 #include "base/memory/singleton.h" 17 #include "base/memory/singleton.h"
18 #include "base/message_loop/message_loop.h" 18 #include "base/message_loop/message_loop.h"
19 #include "base/metrics/histogram_macros.h" 19 #include "base/metrics/histogram_macros.h"
20 #include "base/stl_util.h" 20 #include "base/stl_util.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/sys_info.h" 22 #include "base/sys_info.h"
23 #include "base/threading/thread_task_runner_handle.h" 23 #include "base/threading/thread_task_runner_handle.h"
24 #include "base/trace_event/trace_event.h" 24 #include "base/trace_event/trace_event.h"
25 #include "base/trace_event/trace_event_synthetic_delay.h" 25 #include "base/trace_event/trace_event_synthetic_delay.h"
26 #include "build/build_config.h" 26 #include "build/build_config.h"
27 #include "cc/animation/animation_host.h" 27 #include "cc/animation/animation_host.h"
28 #include "cc/input/touch_action.h"
28 #include "cc/output/compositor_frame_sink.h" 29 #include "cc/output/compositor_frame_sink.h"
29 #include "cc/output/copy_output_request.h" 30 #include "cc/output/copy_output_request.h"
30 #include "cc/scheduler/begin_frame_source.h" 31 #include "cc/scheduler/begin_frame_source.h"
31 #include "cc/trees/layer_tree_host.h" 32 #include "cc/trees/layer_tree_host.h"
32 #include "content/common/content_switches_internal.h" 33 #include "content/common/content_switches_internal.h"
33 #include "content/common/drag_event_source_info.h" 34 #include "content/common/drag_event_source_info.h"
34 #include "content/common/drag_messages.h" 35 #include "content/common/drag_messages.h"
35 #include "content/common/input/synthetic_gesture_packet.h" 36 #include "content/common/input/synthetic_gesture_packet.h"
36 #include "content/common/input_messages.h" 37 #include "content/common/input_messages.h"
37 #include "content/common/render_message_filter.mojom.h" 38 #include "content/common/render_message_filter.mojom.h"
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 void RenderWidget::SetHandlingInputEventForTesting(bool handling_input_event) { 2236 void RenderWidget::SetHandlingInputEventForTesting(bool handling_input_event) {
2236 input_handler_->set_handling_input_event(handling_input_event); 2237 input_handler_->set_handling_input_event(handling_input_event);
2237 } 2238 }
2238 2239
2239 void RenderWidget::HasTouchEventHandlers(bool has_handlers) { 2240 void RenderWidget::HasTouchEventHandlers(bool has_handlers) {
2240 if (render_widget_scheduling_state_) 2241 if (render_widget_scheduling_state_)
2241 render_widget_scheduling_state_->SetHasTouchHandler(has_handlers); 2242 render_widget_scheduling_state_->SetHasTouchHandler(has_handlers);
2242 Send(new ViewHostMsg_HasTouchEventHandlers(routing_id_, has_handlers)); 2243 Send(new ViewHostMsg_HasTouchEventHandlers(routing_id_, has_handlers));
2243 } 2244 }
2244 2245
2245 void RenderWidget::SetTouchAction(blink::WebTouchAction web_touch_action) { 2246 void RenderWidget::SetTouchAction(cc::TouchAction touch_action) {
2246 // Ignore setTouchAction calls that result from synthetic touch events (eg. 2247 // Ignore setTouchAction calls that result from synthetic touch events (eg.
2247 // when blink is emulating touch with mouse). 2248 // when blink is emulating touch with mouse).
2248 if (input_handler_->handling_event_type() != WebInputEvent::kTouchStart) 2249 if (input_handler_->handling_event_type() != WebInputEvent::kTouchStart)
2249 return; 2250 return;
2250 2251
2251 content::TouchAction content_touch_action = 2252 Send(new InputHostMsg_SetTouchAction(routing_id_, touch_action));
2252 static_cast<content::TouchAction>(web_touch_action);
2253 Send(new InputHostMsg_SetTouchAction(routing_id_, content_touch_action));
2254 } 2253 }
2255 2254
2256 void RenderWidget::RegisterRenderFrameProxy(RenderFrameProxy* proxy) { 2255 void RenderWidget::RegisterRenderFrameProxy(RenderFrameProxy* proxy) {
2257 render_frame_proxies_.AddObserver(proxy); 2256 render_frame_proxies_.AddObserver(proxy);
2258 } 2257 }
2259 2258
2260 void RenderWidget::UnregisterRenderFrameProxy(RenderFrameProxy* proxy) { 2259 void RenderWidget::UnregisterRenderFrameProxy(RenderFrameProxy* proxy) {
2261 render_frame_proxies_.RemoveObserver(proxy); 2260 render_frame_proxies_.RemoveObserver(proxy);
2262 } 2261 }
2263 2262
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 // browser side (https://crbug.com/669219). 2336 // browser side (https://crbug.com/669219).
2338 // If there is no WebFrameWidget, then there will be no 2337 // If there is no WebFrameWidget, then there will be no
2339 // InputMethodControllers for a WebLocalFrame. 2338 // InputMethodControllers for a WebLocalFrame.
2340 return nullptr; 2339 return nullptr;
2341 } 2340 }
2342 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) 2341 return static_cast<blink::WebFrameWidget*>(GetWebWidget())
2343 ->GetActiveWebInputMethodController(); 2342 ->GetActiveWebInputMethodController();
2344 } 2343 }
2345 2344
2346 } // namespace content 2345 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698