Chromium Code Reviews| 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_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "content/browser/renderer_host/backing_store_aura.h" | 14 #include "content/browser/renderer_host/backing_store_aura.h" |
| 15 #include "content/browser/renderer_host/dip_util.h" | 15 #include "content/browser/renderer_host/dip_util.h" |
| 16 #include "content/browser/renderer_host/overscroll_controller.h" | |
| 16 #include "content/browser/renderer_host/render_view_host_delegate.h" | 17 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 17 #include "content/browser/renderer_host/render_widget_host_impl.h" | 18 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 18 #include "content/browser/renderer_host/ui_events_helper.h" | 19 #include "content/browser/renderer_host/ui_events_helper.h" |
| 19 #include "content/browser/renderer_host/web_input_event_aura.h" | 20 #include "content/browser/renderer_host/web_input_event_aura.h" |
| 20 #include "content/common/gpu/client/gl_helper.h" | 21 #include "content/common/gpu/client/gl_helper.h" |
| 21 #include "content/common/gpu/gpu_messages.h" | 22 #include "content/common/gpu/gpu_messages.h" |
| 22 #include "content/common/view_messages.h" | 23 #include "content/common/view_messages.h" |
| 23 #include "content/port/browser/render_widget_host_view_port.h" | 24 #include "content/port/browser/render_widget_host_view_port.h" |
| 24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
| (...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1562 } | 1563 } |
| 1563 | 1564 |
| 1564 // Forward event to renderer. | 1565 // Forward event to renderer. |
| 1565 if (CanRendererHandleEvent(event)) | 1566 if (CanRendererHandleEvent(event)) |
| 1566 host_->ForwardMouseEvent(mouse_event); | 1567 host_->ForwardMouseEvent(mouse_event); |
| 1567 } | 1568 } |
| 1568 | 1569 |
| 1569 return ui::ER_UNHANDLED; | 1570 return ui::ER_UNHANDLED; |
| 1570 } | 1571 } |
| 1571 | 1572 |
| 1573 // If the overscroll controller is active, then drop all synthetic move events | |
| 1574 // on the floor. | |
|
sky
2012/11/19 16:25:01
Document why you do this.
sadrul
2012/11/19 16:34:35
Done.
| |
| 1575 if (host_->overscroll_controller() && | |
| 1576 host_->overscroll_controller()->overscroll_mode() != OVERSCROLL_NONE && | |
| 1577 event->type() == ui::ET_MOUSE_MOVED && | |
| 1578 (event->flags() & ui::EF_IS_SYNTHESIZED)) { | |
| 1579 return ui::ER_CONSUMED; | |
| 1580 } | |
| 1581 | |
| 1572 if (event->type() == ui::ET_MOUSEWHEEL) { | 1582 if (event->type() == ui::ET_MOUSEWHEEL) { |
| 1573 WebKit::WebMouseWheelEvent mouse_wheel_event = | 1583 WebKit::WebMouseWheelEvent mouse_wheel_event = |
| 1574 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event)); | 1584 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event)); |
| 1575 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) | 1585 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) |
| 1576 host_->ForwardWheelEvent(mouse_wheel_event); | 1586 host_->ForwardWheelEvent(mouse_wheel_event); |
| 1577 } else if (CanRendererHandleEvent(event)) { | 1587 } else if (CanRendererHandleEvent(event)) { |
| 1578 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); | 1588 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); |
| 1579 ModifyEventMovementAndCoords(&mouse_event); | 1589 ModifyEventMovementAndCoords(&mouse_event); |
| 1580 host_->ForwardMouseEvent(mouse_event); | 1590 host_->ForwardMouseEvent(mouse_event); |
| 1581 } | 1591 } |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1979 RenderWidgetHost* widget) { | 1989 RenderWidgetHost* widget) { |
| 1980 return new RenderWidgetHostViewAura(widget); | 1990 return new RenderWidgetHostViewAura(widget); |
| 1981 } | 1991 } |
| 1982 | 1992 |
| 1983 // static | 1993 // static |
| 1984 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 1994 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 1985 GetScreenInfoForWindow(results, NULL); | 1995 GetScreenInfoForWindow(results, NULL); |
| 1986 } | 1996 } |
| 1987 | 1997 |
| 1988 } // namespace content | 1998 } // namespace content |
| OLD | NEW |