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

Side by Side Diff: Source/web/PopupContainer.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/ExternalPopupMenu.cpp ('k') | Source/web/ValidationMessageClientImpl.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) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 const Vector<PopupItem*>& inputItems = popupData(); 484 const Vector<PopupItem*>& inputItems = popupData();
485 485
486 WebVector<WebMenuItemInfo> outputItems(inputItems.size()); 486 WebVector<WebMenuItemInfo> outputItems(inputItems.size());
487 487
488 for (size_t i = 0; i < inputItems.size(); ++i) { 488 for (size_t i = 0; i < inputItems.size(); ++i) {
489 const PopupItem& inputItem = *inputItems[i]; 489 const PopupItem& inputItem = *inputItems[i];
490 WebMenuItemInfo& outputItem = outputItems[i]; 490 WebMenuItemInfo& outputItem = outputItems[i];
491 491
492 outputItem.label = inputItem.label; 492 outputItem.label = inputItem.label;
493 outputItem.enabled = inputItem.enabled; 493 outputItem.enabled = inputItem.enabled;
494 if (inputItem.textDirection == RTL) 494 outputItem.textDirection = toWebTextDirection(inputItem.textDirection);
495 outputItem.textDirection = WebTextDirectionRightToLeft;
496 else
497 outputItem.textDirection = WebTextDirectionLeftToRight;
498 outputItem.hasTextDirectionOverride = inputItem.hasTextDirectionOverride ; 495 outputItem.hasTextDirectionOverride = inputItem.hasTextDirectionOverride ;
499 496
500 switch (inputItem.type) { 497 switch (inputItem.type) {
501 case PopupItem::TypeOption: 498 case PopupItem::TypeOption:
502 outputItem.type = WebMenuItemInfo::Option; 499 outputItem.type = WebMenuItemInfo::Option;
503 break; 500 break;
504 case PopupItem::TypeGroup: 501 case PopupItem::TypeGroup:
505 outputItem.type = WebMenuItemInfo::Group; 502 outputItem.type = WebMenuItemInfo::Group;
506 break; 503 break;
507 case PopupItem::TypeSeparator: 504 case PopupItem::TypeSeparator:
508 outputItem.type = WebMenuItemInfo::Separator; 505 outputItem.type = WebMenuItemInfo::Separator;
509 break; 506 break;
510 } 507 }
511 } 508 }
512 509
513 info->itemHeight = menuItemHeight(); 510 info->itemHeight = menuItemHeight();
514 info->itemFontSize = menuItemFontSize(); 511 info->itemFontSize = menuItemFontSize();
515 info->selectedIndex = selectedIndex(); 512 info->selectedIndex = selectedIndex();
516 info->items.swap(outputItems); 513 info->items.swap(outputItems);
517 info->rightAligned = menuStyle().textDirection() == RTL; 514 info->rightAligned = menuStyle().textDirection() == RTL;
518 } 515 }
519 516
520 } // namespace blink 517 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/ExternalPopupMenu.cpp ('k') | Source/web/ValidationMessageClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698