| 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 | 2308 |
| 2309 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 2309 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 2310 InputHandlerManager* input_handler_manager = | 2310 InputHandlerManager* input_handler_manager = |
| 2311 render_thread ? render_thread->input_handler_manager() : NULL; | 2311 render_thread ? render_thread->input_handler_manager() : NULL; |
| 2312 if (input_handler_manager) { | 2312 if (input_handler_manager) { |
| 2313 input_handler_manager->ObserveWheelEventAndResultOnMainThread( | 2313 input_handler_manager->ObserveWheelEventAndResultOnMainThread( |
| 2314 routing_id_, wheel_event, scroll_result); | 2314 routing_id_, wheel_event, scroll_result); |
| 2315 } | 2315 } |
| 2316 } | 2316 } |
| 2317 | 2317 |
| 2318 void RenderWidget::hasTouchEventHandlers(bool has_handlers) { | 2318 void RenderWidget::hasEventHandlers(blink::WebEventHandlerClass handler_class, |
| 2319 Send(new ViewHostMsg_HasTouchEventHandlers(routing_id_, has_handlers)); | 2319 bool has_handlers) { |
| 2320 // TODO(jdduke): Consider batching these notifications, posting a task |
| 2321 // to send them asynchronously. |
| 2322 switch (handler_class) { |
| 2323 case blink::WebEventHandlerClassTouch: |
| 2324 Send(new InputHostMsg_HasTouchEventHandlers(routing_id_, has_handlers)); |
| 2325 break; |
| 2326 |
| 2327 case blink::WebEventHandlerClassTouchMove: |
| 2328 Send(new InputHostMsg_HasTouchMoveEventHandlers(routing_id_, |
| 2329 has_handlers)); |
| 2330 break; |
| 2331 |
| 2332 default: |
| 2333 break; |
| 2334 } |
| 2320 } | 2335 } |
| 2321 | 2336 |
| 2322 // Check blink::WebTouchAction and blink::WebTouchActionAuto is kept in sync | 2337 // Check blink::WebTouchAction and blink::WebTouchActionAuto is kept in sync |
| 2323 #define STATIC_ASSERT_WTI_ENUM_MATCH(a, b)
\ | 2338 #define STATIC_ASSERT_WTI_ENUM_MATCH(a, b)
\ |
| 2324 static_assert(int(blink::WebTouchAction##a) == int(TOUCH_ACTION_##b), \ | 2339 static_assert(int(blink::WebTouchAction##a) == int(TOUCH_ACTION_##b), \ |
| 2325 "mismatching enums: " #a) | 2340 "mismatching enums: " #a) |
| 2326 | 2341 |
| 2327 inline content::TouchAction& operator|=(content::TouchAction& a, | 2342 inline content::TouchAction& operator|=(content::TouchAction& a, |
| 2328 content::TouchAction b) { | 2343 content::TouchAction b) { |
| 2329 a = static_cast<content::TouchAction>(static_cast<int>(a) | | 2344 a = static_cast<content::TouchAction>(static_cast<int>(a) | |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2458 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2473 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2459 video_hole_frames_.AddObserver(frame); | 2474 video_hole_frames_.AddObserver(frame); |
| 2460 } | 2475 } |
| 2461 | 2476 |
| 2462 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2477 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2463 video_hole_frames_.RemoveObserver(frame); | 2478 video_hole_frames_.RemoveObserver(frame); |
| 2464 } | 2479 } |
| 2465 #endif // defined(VIDEO_HOLE) | 2480 #endif // defined(VIDEO_HOLE) |
| 2466 | 2481 |
| 2467 } // namespace content | 2482 } // namespace content |
| OLD | NEW |