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