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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
927 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, | 927 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
928 const ui::LatencyInfo& latency_info, | 928 const ui::LatencyInfo& latency_info, |
929 bool is_keyboard_shortcut) { | 929 bool is_keyboard_shortcut) { |
930 base::AutoReset<bool> handling_input_event_resetter( | 930 base::AutoReset<bool> handling_input_event_resetter( |
931 &handling_input_event_, true); | 931 &handling_input_event_, true); |
932 if (!input_event) | 932 if (!input_event) |
933 return; | 933 return; |
934 base::AutoReset<WebInputEvent::Type> handling_event_type_resetter( | 934 base::AutoReset<WebInputEvent::Type> handling_event_type_resetter( |
935 &handling_event_type_, input_event->type); | 935 &handling_event_type_, input_event->type); |
936 #if defined(OS_ANDROID) | 936 #if defined(OS_ANDROID) |
937 // On Android, when the delete key or forward delete key is pressed using IME, | 937 // On Android, when the delete key or forward delete key is pressed using IME, |
aurimas (slooooooooow)
2014/08/29 18:27:21
Please update the comment.
bcwhite
2014/08/29 18:47:12
Done.
| |
938 // |AdapterInputConnection| generates input key events to make sure all JS | 938 // |AdapterInputConnection| generates input key events to make sure all JS |
939 // listeners that monitor KeyUp and KeyDown events receive the proper key | 939 // listeners that monitor KeyUp and KeyDown events receive the proper key |
940 // code. Since this input key event comes from IME, we need to set the | 940 // code. Since this input key event comes from IME, we need to set the |
941 // IME event guard here to make sure it does not interfere with other IME | 941 // IME event guard here to make sure it does not interfere with other IME |
942 // events. | 942 // events. |
943 scoped_ptr<ImeEventGuard> ime_event_guard_maybe; | 943 scoped_ptr<ImeEventGuard> ime_event_guard_maybe; |
944 if (WebInputEvent::isKeyboardEventType(input_event->type)) { | 944 if (WebInputEvent::isKeyboardEventType(input_event->type)) |
945 const WebKeyboardEvent& key_event = | 945 ime_event_guard_maybe.reset(new ImeEventGuard(this)); |
946 *static_cast<const WebKeyboardEvent*>(input_event); | |
947 if (key_event.nativeKeyCode == AKEYCODE_FORWARD_DEL || | |
948 key_event.nativeKeyCode == AKEYCODE_DEL) { | |
949 ime_event_guard_maybe.reset(new ImeEventGuard(this)); | |
950 } | |
951 } | |
952 #endif | 946 #endif |
953 | 947 |
954 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, | 948 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, |
955 &latency_info); | 949 &latency_info); |
956 | 950 |
957 base::TimeTicks start_time; | 951 base::TimeTicks start_time; |
958 if (base::TimeTicks::IsHighResNowFastAndReliable()) | 952 if (base::TimeTicks::IsHighResNowFastAndReliable()) |
959 start_time = base::TimeTicks::HighResNow(); | 953 start_time = base::TimeTicks::HighResNow(); |
960 | 954 |
961 const char* const event_name = | 955 const char* const event_name = |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2178 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2172 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2179 video_hole_frames_.AddObserver(frame); | 2173 video_hole_frames_.AddObserver(frame); |
2180 } | 2174 } |
2181 | 2175 |
2182 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2176 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2183 video_hole_frames_.RemoveObserver(frame); | 2177 video_hole_frames_.RemoveObserver(frame); |
2184 } | 2178 } |
2185 #endif // defined(VIDEO_HOLE) | 2179 #endif // defined(VIDEO_HOLE) |
2186 | 2180 |
2187 } // namespace content | 2181 } // namespace content |
OLD | NEW |