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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 suppress_next_char_events_ = true; | 576 suppress_next_char_events_ = true; |
577 | 577 |
578 IPC::Message* response = | 578 IPC::Message* response = |
579 new ViewHostMsg_HandleInputEvent_ACK(routing_id_, input_event->type, | 579 new ViewHostMsg_HandleInputEvent_ACK(routing_id_, input_event->type, |
580 processed); | 580 processed); |
581 bool event_type_gets_rate_limited = | 581 bool event_type_gets_rate_limited = |
582 input_event->type == WebInputEvent::MouseMove || | 582 input_event->type == WebInputEvent::MouseMove || |
583 input_event->type == WebInputEvent::MouseWheel || | 583 input_event->type == WebInputEvent::MouseWheel || |
584 WebInputEvent::isTouchEventType(input_event->type); | 584 WebInputEvent::isTouchEventType(input_event->type); |
585 bool is_input_throttled = | 585 bool is_input_throttled = |
586 webwidget_->isInputThrottled() || | 586 (webwidget_ ? webwidget_->isInputThrottled() : false) || |
587 paint_aggregator_.HasPendingUpdate(); | 587 paint_aggregator_.HasPendingUpdate(); |
588 | 588 |
589 if (event_type_gets_rate_limited && is_input_throttled && !is_hidden_) { | 589 if (event_type_gets_rate_limited && is_input_throttled && !is_hidden_) { |
590 // We want to rate limit the input events in this case, so we'll wait for | 590 // We want to rate limit the input events in this case, so we'll wait for |
591 // painting to finish before ACKing this message. | 591 // painting to finish before ACKing this message. |
592 if (pending_input_event_ack_.get()) { | 592 if (pending_input_event_ack_.get()) { |
593 // As two different kinds of events could cause us to postpone an ack | 593 // As two different kinds of events could cause us to postpone an ack |
594 // we send it now, if we have one pending. The Browser should never | 594 // we send it now, if we have one pending. The Browser should never |
595 // send us the same kind of event we are delaying the ack for. | 595 // send us the same kind of event we are delaying the ack for. |
596 Send(pending_input_event_ack_.release()); | 596 Send(pending_input_event_ack_.release()); |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, down, scroll_far)); | 1773 Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, down, scroll_far)); |
1774 } | 1774 } |
1775 | 1775 |
1776 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1776 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1777 return false; | 1777 return false; |
1778 } | 1778 } |
1779 | 1779 |
1780 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1780 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1781 return false; | 1781 return false; |
1782 } | 1782 } |
OLD | NEW |