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

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

Issue 62443007: Replace old with new synthetic gesture framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forward declare SyntheticGestureController. Created 7 years, 1 month 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_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"
11 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" 10 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
12 #include "content/browser/renderer_host/render_process_host_impl.h" 11 #include "content/browser/renderer_host/render_process_host_impl.h"
13 #include "content/browser/renderer_host/render_widget_host_impl.h" 12 #include "content/browser/renderer_host/render_widget_host_impl.h"
14 #include "content/port/browser/render_widget_host_view_frame_subscriber.h" 13 #include "content/port/browser/render_widget_host_view_frame_subscriber.h"
15 #include "content/port/browser/synthetic_gesture.h"
16 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 14 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
17 #include "ui/gfx/display.h" 15 #include "ui/gfx/display.h"
18 #include "ui/gfx/screen.h" 16 #include "ui/gfx/screen.h"
19 #include "ui/gfx/size_conversions.h" 17 #include "ui/gfx/size_conversions.h"
20 #include "ui/gfx/size_f.h" 18 #include "ui/gfx/size_f.h"
21 19
22 #if defined(OS_WIN) 20 #if defined(OS_WIN)
23 #include "base/command_line.h" 21 #include "base/command_line.h"
24 #include "base/message_loop/message_loop.h" 22 #include "base/message_loop/message_loop.h"
25 #include "base/win/wrapped_window_proc.h" 23 #include "base/win/wrapped_window_proc.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); 515 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view);
518 if (current_display_area_ == display.work_area() && 516 if (current_display_area_ == display.work_area() &&
519 current_device_scale_factor_ == display.device_scale_factor()) { 517 current_device_scale_factor_ == display.device_scale_factor()) {
520 return false; 518 return false;
521 } 519 }
522 current_display_area_ = display.work_area(); 520 current_display_area_ = display.work_area();
523 current_device_scale_factor_ = display.device_scale_factor(); 521 current_device_scale_factor_ = display.device_scale_factor();
524 return true; 522 return true;
525 } 523 }
526 524
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
542 void RenderWidgetHostViewBase::ProcessAckedTouchEvent( 525 void RenderWidgetHostViewBase::ProcessAckedTouchEvent(
543 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { 526 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) {
544 } 527 }
545 528
546 scoped_ptr<SyntheticGestureTarget> 529 scoped_ptr<SyntheticGestureTarget>
547 RenderWidgetHostViewBase::CreateSyntheticGestureTarget() { 530 RenderWidgetHostViewBase::CreateSyntheticGestureTarget() {
548 RenderWidgetHostImpl* host = 531 RenderWidgetHostImpl* host =
549 RenderWidgetHostImpl::From(GetRenderWidgetHost()); 532 RenderWidgetHostImpl::From(GetRenderWidgetHost());
550 return scoped_ptr<SyntheticGestureTarget>( 533 return scoped_ptr<SyntheticGestureTarget>(
551 new SyntheticGestureTargetBase(host)); 534 new SyntheticGestureTargetBase(host));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 void RenderWidgetHostViewBase::FlushInput() { 586 void RenderWidgetHostViewBase::FlushInput() {
604 RenderWidgetHostImpl* impl = NULL; 587 RenderWidgetHostImpl* impl = NULL;
605 if (GetRenderWidgetHost()) 588 if (GetRenderWidgetHost())
606 impl = RenderWidgetHostImpl::From(GetRenderWidgetHost()); 589 impl = RenderWidgetHostImpl::From(GetRenderWidgetHost());
607 if (!impl) 590 if (!impl)
608 return; 591 return;
609 impl->FlushInput(); 592 impl->FlushInput();
610 } 593 }
611 594
612 } // namespace content 595 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698