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_base.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/accessibility/browser_accessibility_manager.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager.h" |
9 #include "content/browser/gpu/gpu_data_manager_impl.h" | 9 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 10 #include "content/browser/renderer_host/basic_mouse_wheel_smooth_scroll_gesture.
h" |
10 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" | 11 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" |
11 #include "content/browser/renderer_host/render_process_host_impl.h" | 12 #include "content/browser/renderer_host/render_process_host_impl.h" |
12 #include "content/browser/renderer_host/render_widget_host_impl.h" | 13 #include "content/browser/renderer_host/render_widget_host_impl.h" |
13 #include "content/port/browser/render_widget_host_view_frame_subscriber.h" | 14 #include "content/port/browser/render_widget_host_view_frame_subscriber.h" |
| 15 #include "content/port/browser/synthetic_gesture.h" |
14 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 16 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
15 #include "ui/gfx/display.h" | 17 #include "ui/gfx/display.h" |
16 #include "ui/gfx/screen.h" | 18 #include "ui/gfx/screen.h" |
17 #include "ui/gfx/size_conversions.h" | 19 #include "ui/gfx/size_conversions.h" |
18 #include "ui/gfx/size_f.h" | 20 #include "ui/gfx/size_f.h" |
19 | 21 |
20 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
21 #include "base/command_line.h" | 23 #include "base/command_line.h" |
22 #include "base/message_loop/message_loop.h" | 24 #include "base/message_loop/message_loop.h" |
23 #include "base/win/wrapped_window_proc.h" | 25 #include "base/win/wrapped_window_proc.h" |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); | 517 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); |
516 if (current_display_area_ == display.work_area() && | 518 if (current_display_area_ == display.work_area() && |
517 current_device_scale_factor_ == display.device_scale_factor()) { | 519 current_device_scale_factor_ == display.device_scale_factor()) { |
518 return false; | 520 return false; |
519 } | 521 } |
520 current_display_area_ = display.work_area(); | 522 current_display_area_ = display.work_area(); |
521 current_device_scale_factor_ = display.device_scale_factor(); | 523 current_device_scale_factor_ = display.device_scale_factor(); |
522 return true; | 524 return true; |
523 } | 525 } |
524 | 526 |
| 527 SyntheticGesture* RenderWidgetHostViewBase::CreateSmoothScrollGesture( |
| 528 bool scroll_down, int pixels_to_scroll, int mouse_event_x, |
| 529 int mouse_event_y) { |
| 530 return new BasicMouseWheelSmoothScrollGesture(scroll_down, pixels_to_scroll, |
| 531 mouse_event_x, mouse_event_y); |
| 532 } |
| 533 |
| 534 SyntheticGesture* RenderWidgetHostViewBase::CreatePinchGesture( |
| 535 bool zoom_in, int pixels_to_move, int anchor_x, |
| 536 int anchor_y) { |
| 537 // There is no generic implementation for pinch gestures. |
| 538 NOTIMPLEMENTED(); |
| 539 return NULL; |
| 540 } |
| 541 |
525 void RenderWidgetHostViewBase::ProcessAckedTouchEvent( | 542 void RenderWidgetHostViewBase::ProcessAckedTouchEvent( |
526 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { | 543 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { |
527 } | 544 } |
528 | 545 |
529 scoped_ptr<SyntheticGestureTarget> | 546 scoped_ptr<SyntheticGestureTarget> |
530 RenderWidgetHostViewBase::CreateSyntheticGestureTarget() { | 547 RenderWidgetHostViewBase::CreateSyntheticGestureTarget() { |
531 RenderWidgetHostImpl* host = | 548 RenderWidgetHostImpl* host = |
532 RenderWidgetHostImpl::From(GetRenderWidgetHost()); | 549 RenderWidgetHostImpl::From(GetRenderWidgetHost()); |
533 return scoped_ptr<SyntheticGestureTarget>( | 550 return scoped_ptr<SyntheticGestureTarget>( |
534 new SyntheticGestureTargetBase(host)); | 551 new SyntheticGestureTargetBase(host)); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 void RenderWidgetHostViewBase::FlushInput() { | 603 void RenderWidgetHostViewBase::FlushInput() { |
587 RenderWidgetHostImpl* impl = NULL; | 604 RenderWidgetHostImpl* impl = NULL; |
588 if (GetRenderWidgetHost()) | 605 if (GetRenderWidgetHost()) |
589 impl = RenderWidgetHostImpl::From(GetRenderWidgetHost()); | 606 impl = RenderWidgetHostImpl::From(GetRenderWidgetHost()); |
590 if (!impl) | 607 if (!impl) |
591 return; | 608 return; |
592 impl->FlushInput(); | 609 impl->FlushInput(); |
593 } | 610 } |
594 | 611 |
595 } // namespace content | 612 } // namespace content |
OLD | NEW |