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

Side by Side Diff: Source/core/rendering/RenderMenuList.cpp

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/rendering/HitTestResult.cpp ('k') | Source/core/rendering/RenderTheme.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the select element renderer in WebCore. 2 * This file is part of the select element renderer in WebCore.
3 * 3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 m_lastActiveIndex = optionIndex; 381 m_lastActiveIndex = optionIndex;
382 382
383 HTMLSelectElement* select = selectElement(); 383 HTMLSelectElement* select = selectElement();
384 int listIndex = select->optionToListIndex(optionIndex); 384 int listIndex = select->optionToListIndex(optionIndex);
385 if (listIndex < 0 || listIndex >= static_cast<int>(select->listItems().size( ))) 385 if (listIndex < 0 || listIndex >= static_cast<int>(select->listItems().size( )))
386 return; 386 return;
387 387
388 HTMLElement* listItem = select->listItems()[listIndex]; 388 HTMLElement* listItem = select->listItems()[listIndex];
389 ASSERT(listItem); 389 ASSERT(listItem);
390 if (listItem->attached()) { 390 if (listItem->attached()) {
391 if (AccessibilityMenuList* menuList = static_cast<AccessibilityMenuList* >(document().axObjectCache()->get(this))) 391 if (AccessibilityMenuList* menuList = toAccessibilityMenuList(document() .axObjectCache()->get(this)))
392 menuList->didUpdateActiveOption(optionIndex); 392 menuList->didUpdateActiveOption(optionIndex);
393 } 393 }
394 } 394 }
395 395
396 String RenderMenuList::itemText(unsigned listIndex) const 396 String RenderMenuList::itemText(unsigned listIndex) const
397 { 397 {
398 HTMLSelectElement* select = selectElement(); 398 HTMLSelectElement* select = selectElement();
399 const Vector<HTMLElement*>& listItems = select->listItems(); 399 const Vector<HTMLElement*>& listItems = select->listItems();
400 if (listIndex >= listItems.size()) 400 if (listIndex >= listItems.size())
401 return String(); 401 return String();
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 { 610 {
611 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); 611 setTextFromOption(selectElement()->listToOptionIndex(listIndex));
612 } 612 }
613 613
614 FontSelector* RenderMenuList::fontSelector() const 614 FontSelector* RenderMenuList::fontSelector() const
615 { 615 {
616 return document().styleResolver()->fontSelector(); 616 return document().styleResolver()->fontSelector();
617 } 617 }
618 618
619 } 619 }
OLDNEW
« no previous file with comments | « Source/core/rendering/HitTestResult.cpp ('k') | Source/core/rendering/RenderTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698