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

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

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 3 years, 12 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 const ComputedStyle& menuStyle = ownerElement.computedStyle() 259 const ComputedStyle& menuStyle = ownerElement.computedStyle()
260 ? *ownerElement.computedStyle() 260 ? *ownerElement.computedStyle()
261 : *ownerElement.ensureComputedStyle(); 261 : *ownerElement.ensureComputedStyle();
262 const SimpleFontData* fontData = menuStyle.font().primaryFont(); 262 const SimpleFontData* fontData = menuStyle.font().primaryFont();
263 DCHECK(fontData); 263 DCHECK(fontData);
264 info.itemHeight = fontData ? fontData->getFontMetrics().height() : 0; 264 info.itemHeight = fontData ? fontData->getFontMetrics().height() : 0;
265 info.itemFontSize = 265 info.itemFontSize =
266 static_cast<int>(menuStyle.font().getFontDescription().computedSize()); 266 static_cast<int>(menuStyle.font().getFontDescription().computedSize());
267 info.selectedIndex = toExternalPopupMenuItemIndex( 267 info.selectedIndex = toExternalPopupMenuItemIndex(
268 ownerElement.selectedListIndex(), ownerElement); 268 ownerElement.selectedListIndex(), ownerElement);
269 info.rightAligned = menuStyle.direction() == RTL; 269 info.rightAligned = menuStyle.direction() == TextDirection::Rtl;
270 info.allowMultipleSelection = ownerElement.isMultiple(); 270 info.allowMultipleSelection = ownerElement.isMultiple();
271 if (count < itemCount) 271 if (count < itemCount)
272 items.shrink(count); 272 items.shrink(count);
273 info.items = items; 273 info.items = items;
274 } 274 }
275 275
276 int ExternalPopupMenu::toPopupMenuItemIndex(int externalPopupMenuItemIndex, 276 int ExternalPopupMenu::toPopupMenuItemIndex(int externalPopupMenuItemIndex,
277 HTMLSelectElement& ownerElement) { 277 HTMLSelectElement& ownerElement) {
278 if (externalPopupMenuItemIndex < 0) 278 if (externalPopupMenuItemIndex < 0)
279 return externalPopupMenuItemIndex; 279 return externalPopupMenuItemIndex;
(...skipping 21 matching lines...) Expand all
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/platform/text/TextRun.h ('k') | third_party/WebKit/Source/web/PopupMenuImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698