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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10392093: When clicking rapidly 2 different select popups, we could reach a state where (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed description. Created 8 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index e26b07aa067c142dc375594db1b5e759db8e51b9..2b72292334ce6bf55623fced52f8fb467b531713 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1666,8 +1666,14 @@ WebWidget* RenderViewImpl::createPopupMenu(WebKit::WebPopupType popup_type) {
WebExternalPopupMenu* RenderViewImpl::createExternalPopupMenu(
const WebPopupMenuInfo& popup_menu_info,
WebExternalPopupMenuClient* popup_menu_client) {
- // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug.
- DCHECK(!external_popup_menu_.get());
+ // An IPC message is sent to the browser to build and display the actual
+ // popup. The user could have time to click a different select by the time
+ // the popup is shown. In that case external_popup_menu_ is non NULL.
+ // By returning NULL in that case, we instruct WebKit to cancel that new
+ // popup. So from the user perspective, only the first one will show, and
+ // will have to close the first one before another one can be shown.
+ if (external_popup_menu_.get())
+ return NULL;
external_popup_menu_.reset(
new ExternalPopupMenu(this, popup_menu_info, popup_menu_client));
return external_popup_menu_.get();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698