OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_widget_host.h" | 5 #include "chrome/browser/renderer_host/render_widget_host.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
10 #include "base/keyboard_codes.h" | 10 #include "base/keyboard_codes.h" |
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 } | 1146 } |
1147 | 1147 |
1148 void RenderWidgetHost::SetAccessibilityFocus(int acc_obj_id) { | 1148 void RenderWidgetHost::SetAccessibilityFocus(int acc_obj_id) { |
1149 Send(new ViewMsg_SetAccessibilityFocus(routing_id(), acc_obj_id)); | 1149 Send(new ViewMsg_SetAccessibilityFocus(routing_id(), acc_obj_id)); |
1150 } | 1150 } |
1151 | 1151 |
1152 void RenderWidgetHost::AccessibilityDoDefaultAction(int acc_obj_id) { | 1152 void RenderWidgetHost::AccessibilityDoDefaultAction(int acc_obj_id) { |
1153 Send(new ViewMsg_AccessibilityDoDefaultAction(routing_id(), acc_obj_id)); | 1153 Send(new ViewMsg_AccessibilityDoDefaultAction(routing_id(), acc_obj_id)); |
1154 } | 1154 } |
1155 | 1155 |
| 1156 void RenderWidgetHost::AccessibilityObjectChildrenChangeAck() { |
| 1157 Send(new ViewMsg_AccessibilityObjectChildrenChange_ACK(routing_id())); |
| 1158 } |
| 1159 |
1156 void RenderWidgetHost::ProcessKeyboardEventAck(int type, bool processed) { | 1160 void RenderWidgetHost::ProcessKeyboardEventAck(int type, bool processed) { |
1157 if (key_queue_.size() == 0) { | 1161 if (key_queue_.size() == 0) { |
1158 LOG(ERROR) << "Got a KeyEvent back from the renderer but we " | 1162 LOG(ERROR) << "Got a KeyEvent back from the renderer but we " |
1159 << "don't seem to have sent it to the renderer!"; | 1163 << "don't seem to have sent it to the renderer!"; |
1160 } else if (key_queue_.front().type != type) { | 1164 } else if (key_queue_.front().type != type) { |
1161 LOG(ERROR) << "We seem to have a different key type sent from " | 1165 LOG(ERROR) << "We seem to have a different key type sent from " |
1162 << "the renderer. (" << key_queue_.front().type << " vs. " | 1166 << "the renderer. (" << key_queue_.front().type << " vs. " |
1163 << type << "). Ignoring event."; | 1167 << type << "). Ignoring event."; |
1164 | 1168 |
1165 // Something must be wrong. Clear the |key_queue_| and | 1169 // Something must be wrong. Clear the |key_queue_| and |
1166 // |suppress_next_char_events_| so that we can resume from the error. | 1170 // |suppress_next_char_events_| so that we can resume from the error. |
1167 key_queue_.clear(); | 1171 key_queue_.clear(); |
1168 suppress_next_char_events_ = false; | 1172 suppress_next_char_events_ = false; |
1169 } else { | 1173 } else { |
1170 NativeWebKeyboardEvent front_item = key_queue_.front(); | 1174 NativeWebKeyboardEvent front_item = key_queue_.front(); |
1171 key_queue_.pop_front(); | 1175 key_queue_.pop_front(); |
1172 | 1176 |
1173 // We only send unprocessed key event upwards if we are not hidden, | 1177 // We only send unprocessed key event upwards if we are not hidden, |
1174 // because the user has moved away from us and no longer expect any effect | 1178 // because the user has moved away from us and no longer expect any effect |
1175 // of this key event. | 1179 // of this key event. |
1176 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { | 1180 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { |
1177 UnhandledKeyboardEvent(front_item); | 1181 UnhandledKeyboardEvent(front_item); |
1178 | 1182 |
1179 // WARNING: This RenderWidgetHost can be deallocated at this point | 1183 // WARNING: This RenderWidgetHost can be deallocated at this point |
1180 // (i.e. in the case of Ctrl+W, where the call to | 1184 // (i.e. in the case of Ctrl+W, where the call to |
1181 // UnhandledKeyboardEvent destroys this RenderWidgetHost). | 1185 // UnhandledKeyboardEvent destroys this RenderWidgetHost). |
1182 } | 1186 } |
1183 } | 1187 } |
1184 } | 1188 } |
OLD | NEW |