Lines 744-767
void ChromeClientImpl::getPopupMenuInfo(
Source/WebKit/chromium/src/ChromeClientImpl.cpp_sec1
|
744 |
{ |
744 |
{ |
745 |
const Vector<PopupItem*>& inputItems = popupContainer->popupData(); |
745 |
const Vector<PopupItem*>& inputItems = popupContainer->popupData(); |
746 |
|
746 |
|
747 |
WebVector<WebPopupMenuInfo::Item> outputItems(inputItems.size()); |
747 |
WebVector<WebMenuItemInfo> outputItems(inputItems.size()); |
748 |
|
748 |
|
749 |
for (size_t i = 0; i < inputItems.size(); ++i) { |
749 |
for (size_t i = 0; i < inputItems.size(); ++i) { |
750 |
const PopupItem& inputItem = *inputItems[i]; |
750 |
const PopupItem& inputItem = *inputItems[i]; |
751 |
WebPopupMenuInfo::Item& outputItem = outputItems[i]; |
751 |
WebMenuItemInfo& outputItem = outputItems[i]; |
752 |
|
752 |
|
753 |
outputItem.label = inputItem.label; |
753 |
outputItem.label = inputItem.label; |
754 |
outputItem.enabled = inputItem.enabled; |
754 |
outputItem.enabled = inputItem.enabled; |
|
|
755 |
if (inputItem.textDirection == WebCore::RTL) |
756 |
outputItem.textDirection = WebTextDirectionRightToLeft; |
757 |
else |
758 |
outputItem.textDirection = WebTextDirectionLeftToRight; |
759 |
outputItem.hasTextDirectionOverride = inputItem.hasTextDirectionOverride; |
755 |
|
760 |
|
756 |
switch (inputItem.type) { |
761 |
switch (inputItem.type) { |
757 |
case PopupItem::TypeOption: |
762 |
case PopupItem::TypeOption: |
758 |
outputItem.type = WebPopupMenuInfo::Item::Option; |
763 |
outputItem.type = WebMenuItemInfo::Option; |
759 |
break; |
764 |
break; |
760 |
case PopupItem::TypeGroup: |
765 |
case PopupItem::TypeGroup: |
761 |
outputItem.type = WebPopupMenuInfo::Item::Group; |
766 |
outputItem.type = WebMenuItemInfo::Group; |
762 |
break; |
767 |
break; |
763 |
case PopupItem::TypeSeparator: |
768 |
case PopupItem::TypeSeparator: |
764 |
outputItem.type = WebPopupMenuInfo::Item::Separator; |
769 |
outputItem.type = WebMenuItemInfo::Separator; |
765 |
break; |
770 |
break; |
766 |
default: |
771 |
default: |
767 |
ASSERT_NOT_REACHED(); |
772 |
ASSERT_NOT_REACHED(); |