| 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/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 input_method_is_active_(false), | 381 input_method_is_active_(false), |
| 382 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 382 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
| 383 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), | 383 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), |
| 384 can_compose_inline_(true), | 384 can_compose_inline_(true), |
| 385 popup_type_(popup_type), | 385 popup_type_(popup_type), |
| 386 pending_window_rect_count_(0), | 386 pending_window_rect_count_(0), |
| 387 suppress_next_char_events_(false), | 387 suppress_next_char_events_(false), |
| 388 screen_info_(screen_info), | 388 screen_info_(screen_info), |
| 389 device_scale_factor_(screen_info_.deviceScaleFactor), | 389 device_scale_factor_(screen_info_.deviceScaleFactor), |
| 390 is_threaded_compositing_enabled_(false), | 390 is_threaded_compositing_enabled_(false), |
| 391 current_event_latency_info_(NULL), |
| 391 next_output_surface_id_(0), | 392 next_output_surface_id_(0), |
| 392 #if defined(OS_ANDROID) | 393 #if defined(OS_ANDROID) |
| 393 text_field_is_dirty_(false), | 394 text_field_is_dirty_(false), |
| 394 outstanding_ime_acks_(0), | 395 outstanding_ime_acks_(0), |
| 395 body_background_color_(SK_ColorWHITE), | 396 body_background_color_(SK_ColorWHITE), |
| 396 #endif | 397 #endif |
| 397 #if defined(OS_MACOSX) | 398 #if defined(OS_MACOSX) |
| 398 cached_has_main_frame_horizontal_scrollbar_(false), | 399 cached_has_main_frame_horizontal_scrollbar_(false), |
| 399 cached_has_main_frame_vertical_scrollbar_(false), | 400 cached_has_main_frame_vertical_scrollbar_(false), |
| 400 #endif | 401 #endif |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, | 906 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
| 906 const ui::LatencyInfo& latency_info, | 907 const ui::LatencyInfo& latency_info, |
| 907 bool is_keyboard_shortcut) { | 908 bool is_keyboard_shortcut) { |
| 908 base::AutoReset<bool> handling_input_event_resetter( | 909 base::AutoReset<bool> handling_input_event_resetter( |
| 909 &handling_input_event_, true); | 910 &handling_input_event_, true); |
| 910 if (!input_event) | 911 if (!input_event) |
| 911 return; | 912 return; |
| 912 base::AutoReset<WebInputEvent::Type> handling_event_type_resetter( | 913 base::AutoReset<WebInputEvent::Type> handling_event_type_resetter( |
| 913 &handling_event_type_, input_event->type); | 914 &handling_event_type_, input_event->type); |
| 914 | 915 |
| 916 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, |
| 917 &latency_info); |
| 918 |
| 915 base::TimeTicks start_time; | 919 base::TimeTicks start_time; |
| 916 if (base::TimeTicks::IsHighResNowFastAndReliable()) | 920 if (base::TimeTicks::IsHighResNowFastAndReliable()) |
| 917 start_time = base::TimeTicks::HighResNow(); | 921 start_time = base::TimeTicks::HighResNow(); |
| 918 | 922 |
| 919 const char* const event_name = | 923 const char* const event_name = |
| 920 WebInputEventTraits::GetName(input_event->type); | 924 WebInputEventTraits::GetName(input_event->type); |
| 921 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", | 925 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", |
| 922 "event", event_name); | 926 "event", event_name); |
| 923 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); | 927 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); |
| 924 TRACE_EVENT_FLOW_STEP0( | 928 TRACE_EVENT_FLOW_STEP0( |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 | 2100 |
| 2097 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2101 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
| 2098 swapped_out_frames_.AddObserver(frame); | 2102 swapped_out_frames_.AddObserver(frame); |
| 2099 } | 2103 } |
| 2100 | 2104 |
| 2101 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2105 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
| 2102 swapped_out_frames_.RemoveObserver(frame); | 2106 swapped_out_frames_.RemoveObserver(frame); |
| 2103 } | 2107 } |
| 2104 | 2108 |
| 2105 } // namespace content | 2109 } // namespace content |
| OLD | NEW |