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

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

Issue 470883002: Add |WebTextDirection toWebTextDirection(TextDirection)|. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 4 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 | « Source/web/ChromeClientImpl.cpp ('k') | Source/web/PopupContainer.cpp » ('j') | 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « Source/web/ChromeClientImpl.cpp ('k') | Source/web/PopupContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698