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_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 // Returns |true| if the two wheel events should be coalesced. | 87 // Returns |true| if the two wheel events should be coalesced. |
88 bool ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event, | 88 bool ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event, |
89 const WebMouseWheelEvent& new_event) { | 89 const WebMouseWheelEvent& new_event) { |
90 return last_event.modifiers == new_event.modifiers && | 90 return last_event.modifiers == new_event.modifiers && |
91 last_event.scrollByPage == new_event.scrollByPage && | 91 last_event.scrollByPage == new_event.scrollByPage && |
92 last_event.hasPreciseScrollingDeltas | 92 last_event.hasPreciseScrollingDeltas |
93 == new_event.hasPreciseScrollingDeltas && | 93 == new_event.hasPreciseScrollingDeltas && |
94 last_event.phase == new_event.phase && | 94 last_event.phase == new_event.phase && |
95 last_event.momentumPhase == new_event.momentumPhase; | 95 last_event.momentumPhase == new_event.momentumPhase; |
96 } | 96 } |
97 | |
98 } // namespace | 97 } // namespace |
99 | 98 |
100 | 99 |
101 // static | 100 // static |
102 void RenderWidgetHost::RemoveAllBackingStores() { | 101 void RenderWidgetHost::RemoveAllBackingStores() { |
103 BackingStoreManager::RemoveAllBackingStores(); | 102 BackingStoreManager::RemoveAllBackingStores(); |
104 } | 103 } |
105 | 104 |
106 // static | 105 // static |
107 size_t RenderWidgetHost::BackingStoreMemorySize() { | 106 size_t RenderWidgetHost::BackingStoreMemorySize() { |
(...skipping 15 matching lines...) Expand all Loading... | |
123 surface_id_(0), | 122 surface_id_(0), |
124 is_loading_(false), | 123 is_loading_(false), |
125 is_hidden_(false), | 124 is_hidden_(false), |
126 is_fullscreen_(false), | 125 is_fullscreen_(false), |
127 is_accelerated_compositing_active_(false), | 126 is_accelerated_compositing_active_(false), |
128 repaint_ack_pending_(false), | 127 repaint_ack_pending_(false), |
129 resize_ack_pending_(false), | 128 resize_ack_pending_(false), |
130 should_auto_resize_(false), | 129 should_auto_resize_(false), |
131 mouse_move_pending_(false), | 130 mouse_move_pending_(false), |
132 mouse_wheel_pending_(false), | 131 mouse_wheel_pending_(false), |
133 select_range_pending_(false), | |
sadrul
2012/08/16 16:08:15
unintentional?
rjkroege
2012/08/16 17:12:26
Done.
| |
134 needs_repainting_on_restore_(false), | 132 needs_repainting_on_restore_(false), |
135 is_unresponsive_(false), | 133 is_unresponsive_(false), |
136 in_flight_event_count_(0), | 134 in_flight_event_count_(0), |
137 in_get_backing_store_(false), | 135 in_get_backing_store_(false), |
138 abort_get_backing_store_(false), | 136 abort_get_backing_store_(false), |
139 view_being_painted_(false), | 137 view_being_painted_(false), |
140 ignore_input_events_(false), | 138 ignore_input_events_(false), |
141 text_direction_updated_(false), | 139 text_direction_updated_(false), |
142 text_direction_(WebKit::WebTextDirectionLeftToRight), | 140 text_direction_(WebKit::WebTextDirectionLeftToRight), |
143 text_direction_canceled_(false), | 141 text_direction_canceled_(false), |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
921 void RenderWidgetHostImpl::ForwardGestureEvent( | 919 void RenderWidgetHostImpl::ForwardGestureEvent( |
922 const WebKit::WebGestureEvent& gesture_event) { | 920 const WebKit::WebGestureEvent& gesture_event) { |
923 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardGestureEvent"); | 921 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardGestureEvent"); |
924 if (ignore_input_events_ || process_->IgnoreInputEvents() || | 922 if (ignore_input_events_ || process_->IgnoreInputEvents() || |
925 !gesture_event_filter_->ShouldForward(gesture_event)) | 923 !gesture_event_filter_->ShouldForward(gesture_event)) |
926 return; | 924 return; |
927 | 925 |
928 ForwardInputEvent(gesture_event, sizeof(WebGestureEvent), false); | 926 ForwardInputEvent(gesture_event, sizeof(WebGestureEvent), false); |
929 } | 927 } |
930 | 928 |
929 void RenderWidgetHostImpl::ForwardGestureEventImmediately( | |
930 const WebKit::WebGestureEvent& gesture_event) { | |
931 if (ignore_input_events_ || process_->IgnoreInputEvents()) | |
932 return; | |
933 ForwardInputEvent(gesture_event, sizeof(WebGestureEvent), false); | |
934 } | |
935 | |
931 void RenderWidgetHostImpl::ForwardKeyboardEvent( | 936 void RenderWidgetHostImpl::ForwardKeyboardEvent( |
932 const NativeWebKeyboardEvent& key_event) { | 937 const NativeWebKeyboardEvent& key_event) { |
933 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardKeyboardEvent"); | 938 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardKeyboardEvent"); |
934 if (ignore_input_events_ || process_->IgnoreInputEvents()) | 939 if (ignore_input_events_ || process_->IgnoreInputEvents()) |
935 return; | 940 return; |
936 | 941 |
937 if (key_event.type == WebKeyboardEvent::Char && | 942 if (key_event.type == WebKeyboardEvent::Char && |
938 (key_event.windowsKeyCode == ui::VKEY_RETURN || | 943 (key_event.windowsKeyCode == ui::VKEY_RETURN || |
939 key_event.windowsKeyCode == ui::VKEY_SPACE)) { | 944 key_event.windowsKeyCode == ui::VKEY_SPACE)) { |
940 OnUserGesture(); | 945 OnUserGesture(); |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2009 // indicate that no callback is in progress (i.e. without this line | 2014 // indicate that no callback is in progress (i.e. without this line |
2010 // DelayedAutoResized will not get called again). | 2015 // DelayedAutoResized will not get called again). |
2011 new_auto_size_.SetSize(0, 0); | 2016 new_auto_size_.SetSize(0, 0); |
2012 if (!should_auto_resize_) | 2017 if (!should_auto_resize_) |
2013 return; | 2018 return; |
2014 | 2019 |
2015 OnRenderAutoResized(new_size); | 2020 OnRenderAutoResized(new_size); |
2016 } | 2021 } |
2017 | 2022 |
2018 } // namespace content | 2023 } // namespace content |
OLD | NEW |