OLD | NEW |
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 popupItem.label = m_popupMenuClient->itemText(i); | 193 popupItem.label = m_popupMenuClient->itemText(i); |
194 popupItem.toolTip = m_popupMenuClient->itemToolTip(i); | 194 popupItem.toolTip = m_popupMenuClient->itemToolTip(i); |
195 if (m_popupMenuClient->itemIsSeparator(i)) | 195 if (m_popupMenuClient->itemIsSeparator(i)) |
196 popupItem.type = WebMenuItemInfo::Separator; | 196 popupItem.type = WebMenuItemInfo::Separator; |
197 else if (m_popupMenuClient->itemIsLabel(i)) | 197 else if (m_popupMenuClient->itemIsLabel(i)) |
198 popupItem.type = WebMenuItemInfo::Group; | 198 popupItem.type = WebMenuItemInfo::Group; |
199 else | 199 else |
200 popupItem.type = WebMenuItemInfo::Option; | 200 popupItem.type = WebMenuItemInfo::Option; |
201 popupItem.enabled = m_popupMenuClient->itemIsEnabled(i); | 201 popupItem.enabled = m_popupMenuClient->itemIsEnabled(i); |
202 popupItem.checked = m_popupMenuClient->itemIsSelected(i); | 202 popupItem.checked = m_popupMenuClient->itemIsSelected(i); |
203 if (style.textDirection() == RTL) | 203 popupItem.textDirection = toWebTextDirection(style.textDirection()); |
204 popupItem.textDirection = WebTextDirectionRightToLeft; | |
205 else | |
206 popupItem.textDirection = WebTextDirectionLeftToRight; | |
207 popupItem.hasTextDirectionOverride = style.hasTextDirectionOverride(); | 204 popupItem.hasTextDirectionOverride = style.hasTextDirectionOverride(); |
208 } | 205 } |
209 | 206 |
210 info->itemHeight = m_popupMenuClient->menuStyle().font().fontMetrics().heigh
t(); | 207 info->itemHeight = m_popupMenuClient->menuStyle().font().fontMetrics().heigh
t(); |
211 info->itemFontSize = static_cast<int>(m_popupMenuClient->menuStyle().font().
fontDescription().computedSize()); | 208 info->itemFontSize = static_cast<int>(m_popupMenuClient->menuStyle().font().
fontDescription().computedSize()); |
212 info->selectedIndex = toExternalPopupMenuItemIndex(m_popupMenuClient->select
edIndex()); | 209 info->selectedIndex = toExternalPopupMenuItemIndex(m_popupMenuClient->select
edIndex()); |
213 info->rightAligned = m_popupMenuClient->menuStyle().textDirection() == RTL; | 210 info->rightAligned = m_popupMenuClient->menuStyle().textDirection() == RTL; |
214 info->allowMultipleSelection = m_popupMenuClient->multiple(); | 211 info->allowMultipleSelection = m_popupMenuClient->multiple(); |
215 info->items = items; | 212 info->items = items; |
216 } | 213 } |
(...skipping 27 matching lines...) Expand all Loading... |
244 if (m_popupMenuClient->itemStyle(i).isDisplayNone()) | 241 if (m_popupMenuClient->itemStyle(i).isDisplayNone()) |
245 continue; | 242 continue; |
246 if (popupMenuItemIndex == i) | 243 if (popupMenuItemIndex == i) |
247 return indexTracker; | 244 return indexTracker; |
248 ++indexTracker; | 245 ++indexTracker; |
249 } | 246 } |
250 return -1; | 247 return -1; |
251 } | 248 } |
252 | 249 |
253 } // namespace blink | 250 } // namespace blink |
OLD | NEW |