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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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, |
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 } | 946 } |
guohui
2014/08/29 18:12:57
nits: removes extra {}
| |
952 #endif | 947 #endif |
953 | 948 |
954 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, | 949 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, |
955 &latency_info); | 950 &latency_info); |
956 | 951 |
957 base::TimeTicks start_time; | 952 base::TimeTicks start_time; |
958 if (base::TimeTicks::IsHighResNowFastAndReliable()) | 953 if (base::TimeTicks::IsHighResNowFastAndReliable()) |
959 start_time = base::TimeTicks::HighResNow(); | 954 start_time = base::TimeTicks::HighResNow(); |
960 | 955 |
961 const char* const event_name = | 956 const char* const event_name = |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2178 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2173 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2179 video_hole_frames_.AddObserver(frame); | 2174 video_hole_frames_.AddObserver(frame); |
2180 } | 2175 } |
2181 | 2176 |
2182 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2177 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2183 video_hole_frames_.RemoveObserver(frame); | 2178 video_hole_frames_.RemoveObserver(frame); |
2184 } | 2179 } |
2185 #endif // defined(VIDEO_HOLE) | 2180 #endif // defined(VIDEO_HOLE) |
2186 | 2181 |
2187 } // namespace content | 2182 } // namespace content |
OLD | NEW |