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

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

Issue 11773007: Add initial support for handling touch events in desktop chrome AURA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
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_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"
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 if (should_not_forward) { 1496 if (should_not_forward) {
1497 synthetic_move_sent_ = false; 1497 synthetic_move_sent_ = false;
1498 } else { 1498 } else {
1499 // Check if the mouse has reached the border and needs to be centered. 1499 // Check if the mouse has reached the border and needs to be centered.
1500 if (ShouldMoveToCenter()) { 1500 if (ShouldMoveToCenter()) {
1501 synthetic_move_sent_ = true; 1501 synthetic_move_sent_ = true;
1502 window_->MoveCursorTo(center); 1502 window_->MoveCursorTo(center);
1503 } 1503 }
1504 1504
1505 // Forward event to renderer. 1505 // Forward event to renderer.
1506 if (CanRendererHandleEvent(event)) 1506 if (CanRendererHandleEvent(event) &&
1507 !(event->flags() & ui::EF_FROM_TOUCH))
1507 host_->ForwardMouseEvent(mouse_event); 1508 host_->ForwardMouseEvent(mouse_event);
1508 } 1509 }
1509 return; 1510 return;
1510 } 1511 }
1511 1512
1512 // As the overscroll is handled during scroll events from the trackpad, the 1513 // As the overscroll is handled during scroll events from the trackpad, the
1513 // RWHVA window is transformed by the overscroll controller. This transform 1514 // RWHVA window is transformed by the overscroll controller. This transform
1514 // triggers a synthetic mouse-move event to be generated (by the aura 1515 // triggers a synthetic mouse-move event to be generated (by the aura
1515 // RootWindow). But this event interferes with the overscroll gesture. So, 1516 // RootWindow). But this event interferes with the overscroll gesture. So,
1516 // ignore such synthetic mouse-move events if an overscroll gesture is in 1517 // ignore such synthetic mouse-move events if an overscroll gesture is in
1517 // progress. 1518 // progress.
1518 if (host_->overscroll_controller() && 1519 if (host_->overscroll_controller() &&
1519 host_->overscroll_controller()->overscroll_mode() != OVERSCROLL_NONE && 1520 host_->overscroll_controller()->overscroll_mode() != OVERSCROLL_NONE &&
1520 event->flags() & ui::EF_IS_SYNTHESIZED && 1521 event->flags() & ui::EF_IS_SYNTHESIZED &&
1521 (event->type() == ui::ET_MOUSE_ENTERED || 1522 (event->type() == ui::ET_MOUSE_ENTERED ||
1522 event->type() == ui::ET_MOUSE_EXITED || 1523 event->type() == ui::ET_MOUSE_EXITED ||
1523 event->type() == ui::ET_MOUSE_MOVED)) { 1524 event->type() == ui::ET_MOUSE_MOVED)) {
1524 event->StopPropagation(); 1525 event->StopPropagation();
1525 return; 1526 return;
1526 } 1527 }
1527 1528
1528 if (event->type() == ui::ET_MOUSEWHEEL) { 1529 if (event->type() == ui::ET_MOUSEWHEEL) {
1529 WebKit::WebMouseWheelEvent mouse_wheel_event = 1530 WebKit::WebMouseWheelEvent mouse_wheel_event =
1530 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event)); 1531 MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event));
1531 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) 1532 if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0)
1532 host_->ForwardWheelEvent(mouse_wheel_event); 1533 host_->ForwardWheelEvent(mouse_wheel_event);
1533 } else if (CanRendererHandleEvent(event)) { 1534 } else if (CanRendererHandleEvent(event) &&
1535 !(event->flags() & ui::EF_FROM_TOUCH)) {
1534 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); 1536 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event);
1535 ModifyEventMovementAndCoords(&mouse_event); 1537 ModifyEventMovementAndCoords(&mouse_event);
1536 host_->ForwardMouseEvent(mouse_event); 1538 host_->ForwardMouseEvent(mouse_event);
1537 } 1539 }
1538 1540
1539 switch (event->type()) { 1541 switch (event->type()) {
1540 case ui::ET_MOUSE_PRESSED: 1542 case ui::ET_MOUSE_PRESSED:
1541 window_->SetCapture(); 1543 window_->SetCapture();
1542 // Confirm existing composition text on mouse click events, to make sure 1544 // Confirm existing composition text on mouse click events, to make sure
1543 // the input caret won't be moved with an ongoing composition text. 1545 // the input caret won't be moved with an ongoing composition text.
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 RenderWidgetHost* widget) { 1970 RenderWidgetHost* widget) {
1969 return new RenderWidgetHostViewAura(widget); 1971 return new RenderWidgetHostViewAura(widget);
1970 } 1972 }
1971 1973
1972 // static 1974 // static
1973 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1975 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1974 GetScreenInfoForWindow(results, NULL); 1976 GetScreenInfoForWindow(results, NULL);
1975 } 1977 }
1976 1978
1977 } // namespace content 1979 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_root_window_host_win.h » ('j') | ui/views/widget/native_widget_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698