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

Side by Side Diff: third_party/WebKit/Source/web/ContextMenuClientImpl.cpp

Issue 2612903007: Migrate WTF::Vector::append() to ::push_back() [part 15 of N] (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 break; 435 break;
436 case SeparatorType: 436 case SeparatorType:
437 outputItem.type = WebMenuItemInfo::Separator; 437 outputItem.type = WebMenuItemInfo::Separator;
438 break; 438 break;
439 case SubmenuType: 439 case SubmenuType:
440 outputItem.type = WebMenuItemInfo::SubMenu; 440 outputItem.type = WebMenuItemInfo::SubMenu;
441 populateSubMenuItems(inputItem->subMenuItems(), 441 populateSubMenuItems(inputItem->subMenuItems(),
442 outputItem.subMenuItems); 442 outputItem.subMenuItems);
443 break; 443 break;
444 } 444 }
445 subItems.append(outputItem); 445 subItems.push_back(outputItem);
446 } 446 }
447 447
448 WebVector<WebMenuItemInfo> outputItems(subItems.size()); 448 WebVector<WebMenuItemInfo> outputItems(subItems.size());
449 for (size_t i = 0; i < subItems.size(); ++i) 449 for (size_t i = 0; i < subItems.size(); ++i)
450 outputItems[i] = subItems[i]; 450 outputItems[i] = subItems[i];
451 subMenuItems.swap(outputItems); 451 subMenuItems.swap(outputItems);
452 } 452 }
453 453
454 void ContextMenuClientImpl::populateCustomMenuItems( 454 void ContextMenuClientImpl::populateCustomMenuItems(
455 const ContextMenu* defaultMenu, 455 const ContextMenu* defaultMenu,
456 WebContextMenuData* data) { 456 WebContextMenuData* data) {
457 populateSubMenuItems(defaultMenu->items(), data->customItems); 457 populateSubMenuItems(defaultMenu->items(), data->customItems);
458 } 458 }
459 459
460 } // namespace blink 460 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698