OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 WebVector<WebMenuItemInfo>& sub_menu_items) { | 522 WebVector<WebMenuItemInfo>& sub_menu_items) { |
523 Vector<WebMenuItemInfo> sub_items; | 523 Vector<WebMenuItemInfo> sub_items; |
524 for (size_t i = 0; i < input_menu.size(); ++i) { | 524 for (size_t i = 0; i < input_menu.size(); ++i) { |
525 const ContextMenuItem* input_item = &input_menu.at(i); | 525 const ContextMenuItem* input_item = &input_menu.at(i); |
526 if (input_item->Action() < kContextMenuItemBaseCustomTag || | 526 if (input_item->Action() < kContextMenuItemBaseCustomTag || |
527 input_item->Action() > kContextMenuItemLastCustomTag) | 527 input_item->Action() > kContextMenuItemLastCustomTag) |
528 continue; | 528 continue; |
529 | 529 |
530 WebMenuItemInfo output_item; | 530 WebMenuItemInfo output_item; |
531 output_item.label = input_item->Title(); | 531 output_item.label = input_item->Title(); |
532 output_item.icon = input_item->Icon(); | |
533 output_item.enabled = input_item->Enabled(); | 532 output_item.enabled = input_item->Enabled(); |
534 output_item.checked = input_item->Checked(); | 533 output_item.checked = input_item->Checked(); |
535 output_item.action = static_cast<unsigned>(input_item->Action() - | 534 output_item.action = static_cast<unsigned>(input_item->Action() - |
536 kContextMenuItemBaseCustomTag); | 535 kContextMenuItemBaseCustomTag); |
537 switch (input_item->GetType()) { | 536 switch (input_item->GetType()) { |
538 case kActionType: | 537 case kActionType: |
539 output_item.type = WebMenuItemInfo::kOption; | 538 output_item.type = WebMenuItemInfo::kOption; |
540 break; | 539 break; |
541 case kCheckableActionType: | 540 case kCheckableActionType: |
542 output_item.type = WebMenuItemInfo::kCheckableOption; | 541 output_item.type = WebMenuItemInfo::kCheckableOption; |
(...skipping 16 matching lines...) Expand all Loading... |
559 sub_menu_items.Swap(output_items); | 558 sub_menu_items.Swap(output_items); |
560 } | 559 } |
561 | 560 |
562 void ContextMenuClientImpl::PopulateCustomMenuItems( | 561 void ContextMenuClientImpl::PopulateCustomMenuItems( |
563 const ContextMenu* default_menu, | 562 const ContextMenu* default_menu, |
564 WebContextMenuData* data) { | 563 WebContextMenuData* data) { |
565 PopulateSubMenuItems(default_menu->Items(), data->custom_items); | 564 PopulateSubMenuItems(default_menu->Items(), data->custom_items); |
566 } | 565 } |
567 | 566 |
568 } // namespace blink | 567 } // namespace blink |
OLD | NEW |