| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_event_handler.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h" |
| 6 | 6 |
| 7 #include "base/metrics/user_metrics.h" | 7 #include "base/metrics/user_metrics.h" |
| 8 #include "base/metrics/user_metrics_action.h" | 8 #include "base/metrics/user_metrics_action.h" |
| 9 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" | 9 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
| 10 #include "content/browser/renderer_host/overscroll_controller.h" | 10 #include "content/browser/renderer_host/overscroll_controller.h" |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED) | 570 if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED) |
| 571 return false; | 571 return false; |
| 572 | 572 |
| 573 if (event->type() == ui::ET_MOUSE_EXITED) { | 573 if (event->type() == ui::ET_MOUSE_EXITED) { |
| 574 if (mouse_locked || selection_popup) | 574 if (mouse_locked || selection_popup) |
| 575 return false; | 575 return false; |
| 576 #if defined(OS_WIN) || defined(OS_LINUX) | 576 #if defined(OS_WIN) || defined(OS_LINUX) |
| 577 // Don't forward the mouse leave message which is received when the context | 577 // Don't forward the mouse leave message which is received when the context |
| 578 // menu is displayed by the page. This confuses the page and causes state | 578 // menu is displayed by the page. This confuses the page and causes state |
| 579 // changes. | 579 // changes. |
| 580 if (host_view_->IsShowingContextMenu()) | 580 if (host_->delegate() && host_->delegate()->IsShowingContextMenuOnPage()) |
| 581 return false; | 581 return false; |
| 582 #endif | 582 #endif |
| 583 return true; | 583 return true; |
| 584 } | 584 } |
| 585 | 585 |
| 586 #if defined(OS_WIN) | 586 #if defined(OS_WIN) |
| 587 // Renderer cannot handle WM_XBUTTON or NC events. | 587 // Renderer cannot handle WM_XBUTTON or NC events. |
| 588 switch (event->native_event().message) { | 588 switch (event->native_event().message) { |
| 589 case WM_XBUTTONDOWN: | 589 case WM_XBUTTONDOWN: |
| 590 case WM_XBUTTONUP: | 590 case WM_XBUTTONUP: |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 bool non_zero_delta = | 952 bool non_zero_delta = |
| 953 mouse_wheel_event.delta_x || mouse_wheel_event.delta_y; | 953 mouse_wheel_event.delta_x || mouse_wheel_event.delta_y; |
| 954 mouse_wheel_event.phase = non_zero_delta | 954 mouse_wheel_event.phase = non_zero_delta |
| 955 ? blink::WebMouseWheelEvent::kPhaseChanged | 955 ? blink::WebMouseWheelEvent::kPhaseChanged |
| 956 : blink::WebMouseWheelEvent::kPhaseStationary; | 956 : blink::WebMouseWheelEvent::kPhaseStationary; |
| 957 mouse_wheel_end_dispatch_timer_.Reset(); | 957 mouse_wheel_end_dispatch_timer_.Reset(); |
| 958 } | 958 } |
| 959 } | 959 } |
| 960 | 960 |
| 961 } // namespace content | 961 } // namespace content |
| OLD | NEW |