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

Side by Side Diff: third_party/WebKit/Source/web/ExternalPopupMenu.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) 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 if (indices.size() == 0) { 208 if (indices.size() == 0) {
209 ownerElement->selectOptionByPopup(-1); 209 ownerElement->selectOptionByPopup(-1);
210 } else if (!ownerElement->isMultiple()) { 210 } else if (!ownerElement->isMultiple()) {
211 ownerElement->selectOptionByPopup( 211 ownerElement->selectOptionByPopup(
212 toPopupMenuItemIndex(indices[indices.size() - 1], *ownerElement)); 212 toPopupMenuItemIndex(indices[indices.size() - 1], *ownerElement));
213 } else { 213 } else {
214 Vector<int> listIndices; 214 Vector<int> listIndices;
215 listIndices.reserveCapacity(indices.size()); 215 listIndices.reserveCapacity(indices.size());
216 for (size_t i = 0; i < indices.size(); ++i) 216 for (size_t i = 0; i < indices.size(); ++i)
217 listIndices.append(toPopupMenuItemIndex(indices[i], *ownerElement)); 217 listIndices.push_back(toPopupMenuItemIndex(indices[i], *ownerElement));
218 ownerElement->selectMultipleOptionsByPopup(listIndices); 218 ownerElement->selectMultipleOptionsByPopup(listIndices);
219 } 219 }
220 220
221 m_webExternalPopupMenu = 0; 221 m_webExternalPopupMenu = 0;
222 } 222 }
223 223
224 void ExternalPopupMenu::didCancel() { 224 void ExternalPopupMenu::didCancel() {
225 if (m_ownerElement) 225 if (m_ownerElement)
226 m_ownerElement->popupDidHide(); 226 m_ownerElement->popupDidHide();
227 m_webExternalPopupMenu = 0; 227 m_webExternalPopupMenu = 0;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 if (ownerElement.itemIsDisplayNone(*items[i])) 301 if (ownerElement.itemIsDisplayNone(*items[i]))
302 continue; 302 continue;
303 if (popupMenuItemIndex == i) 303 if (popupMenuItemIndex == i)
304 return indexTracker; 304 return indexTracker;
305 ++indexTracker; 305 ++indexTracker;
306 } 306 }
307 return -1; 307 return -1;
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/DateTimeChooserImpl.cpp ('k') | third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698