Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 13912016: [Autofill] Handle the Tab Key in the new UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index d84036b63929a0fc5f1ac3c1a1f09bf11180dae6..56c26bd5766385323d62d22df45f9f332770513d 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2218,9 +2218,11 @@ bool RenderWidgetHostImpl::KeyPressListenersHandleEvent(
if (event.skip_in_browser || event.type != WebKeyboardEvent::RawKeyDown)
return false;
- for (std::list<KeyboardListener*>::iterator it = keyboard_listeners_.begin();
- it != keyboard_listeners_.end(); ++it) {
- if ((*it)->HandleKeyPressEvent(event))
+ std::list<KeyboardListener*>::iterator it = keyboard_listeners_.begin();
+ while(it != keyboard_listeners_.end()) {
+ // It is possible for the handler to delete itself and not handle the key
+ // press.
+ if ((*(it++))->HandleKeyPressEvent(event))
Ilya Sherman 2013/04/18 00:33:32 This isn't guaranteed to work. You should (a) use
csharp 2013/04/18 19:53:02 Ah, I didn't know about ObserverList, awesome.
return true;
}
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698