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

Side by Side Diff: Source/web/ExternalPopupMenu.cpp

Issue 208243012: Mac: Do not call PopupMenuClient::popupDidHide in ExternalPopupMenu:show. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/platform/mac/fast/forms/select/select-disabled-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 { 57 {
58 } 58 }
59 59
60 ExternalPopupMenu::~ExternalPopupMenu() 60 ExternalPopupMenu::~ExternalPopupMenu()
61 { 61 {
62 } 62 }
63 63
64 void ExternalPopupMenu::show(const FloatQuad& controlPosition, const IntSize&, i nt index) 64 void ExternalPopupMenu::show(const FloatQuad& controlPosition, const IntSize&, i nt index)
65 { 65 {
66 IntRect rect(controlPosition.enclosingBoundingBox()); 66 IntRect rect(controlPosition.enclosingBoundingBox());
67 // WebCore reuses the PopupMenu of a page. 67 // WebCore reuses the PopupMenu of an element.
68 // For simplicity, we do recreate the actual external popup everytime. 68 // For simplicity, we do recreate the actual external popup everytime.
69 hide(); 69 if (m_webExternalPopupMenu) {
70 m_webExternalPopupMenu->close();
71 m_webExternalPopupMenu = 0;
72 }
70 73
71 WebPopupMenuInfo info; 74 WebPopupMenuInfo info;
72 getPopupMenuInfo(&info); 75 getPopupMenuInfo(&info);
73 if (info.items.isEmpty()) 76 if (info.items.isEmpty())
74 return; 77 return;
75 m_webExternalPopupMenu = m_webView.client()->createExternalPopupMenu(info, t his); 78 m_webExternalPopupMenu = m_webView.client()->createExternalPopupMenu(info, t his);
76 if (m_webExternalPopupMenu) { 79 if (m_webExternalPopupMenu) {
77 m_webExternalPopupMenu->show(m_frameView->contentsToWindow(rect)); 80 m_webExternalPopupMenu->show(m_frameView->contentsToWindow(rect));
78 #if OS(MACOSX) 81 #if OS(MACOSX)
79 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); 82 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 209
207 info->itemHeight = m_popupMenuClient->menuStyle().font().fontMetrics().heigh t(); 210 info->itemHeight = m_popupMenuClient->menuStyle().font().fontMetrics().heigh t();
208 info->itemFontSize = static_cast<int>(m_popupMenuClient->menuStyle().font(). fontDescription().computedSize()); 211 info->itemFontSize = static_cast<int>(m_popupMenuClient->menuStyle().font(). fontDescription().computedSize());
209 info->selectedIndex = m_popupMenuClient->selectedIndex(); 212 info->selectedIndex = m_popupMenuClient->selectedIndex();
210 info->rightAligned = m_popupMenuClient->menuStyle().textDirection() == WebCo re::RTL; 213 info->rightAligned = m_popupMenuClient->menuStyle().textDirection() == WebCo re::RTL;
211 info->allowMultipleSelection = m_popupMenuClient->multiple(); 214 info->allowMultipleSelection = m_popupMenuClient->multiple();
212 info->items.swap(items); 215 info->items.swap(items);
213 } 216 }
214 217
215 } 218 }
OLDNEW
« no previous file with comments | « LayoutTests/platform/mac/fast/forms/select/select-disabled-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698