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

Side by Side Diff: Source/core/layout/LayoutScrollbar.cpp

Issue 1245323002: Pass scroll bar placement as an enum instead of std::string (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updates per code review Created 5 years, 5 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/css/SelectorChecker.cpp ('k') | Source/platform/scroll/ScrollTypes.h » ('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 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 RefPtr<ComputedStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partTyp e, pseudoForScrollbarPart(partType)) : PassRefPtr<ComputedStyle>(nullptr); 231 RefPtr<ComputedStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partTyp e, pseudoForScrollbarPart(partType)) : PassRefPtr<ComputedStyle>(nullptr);
232 232
233 bool needLayoutObject = !destroy && partStyle && partStyle->display() != NON E; 233 bool needLayoutObject = !destroy && partStyle && partStyle->display() != NON E;
234 234
235 if (needLayoutObject && partStyle->display() != BLOCK) { 235 if (needLayoutObject && partStyle->display() != BLOCK) {
236 // See if we are a button that should not be visible according to OS set tings. 236 // See if we are a button that should not be visible according to OS set tings.
237 ScrollbarButtonsPlacement buttonsPlacement = theme()->buttonsPlacement() ; 237 ScrollbarButtonsPlacement buttonsPlacement = theme()->buttonsPlacement() ;
238 switch (partType) { 238 switch (partType) {
239 case BackButtonStartPart: 239 case BackButtonStartPart:
240 needLayoutObject = (buttonsPlacement == ScrollbarButtonsSingle || bu ttonsPlacement == ScrollbarButtonsDoubleStart 240 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementSin gle || buttonsPlacement == ScrollbarButtonsPlacementDoubleStart
241 || buttonsPlacement == ScrollbarButtonsDoubleBoth); 241 || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth);
242 break; 242 break;
243 case ForwardButtonStartPart: 243 case ForwardButtonStartPart:
244 needLayoutObject = (buttonsPlacement == ScrollbarButtonsDoubleStart || buttonsPlacement == ScrollbarButtonsDoubleBoth); 244 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementDou bleStart || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth);
245 break; 245 break;
246 case BackButtonEndPart: 246 case BackButtonEndPart:
247 needLayoutObject = (buttonsPlacement == ScrollbarButtonsDoubleEnd || buttonsPlacement == ScrollbarButtonsDoubleBoth); 247 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementDou bleEnd || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth);
248 break; 248 break;
249 case ForwardButtonEndPart: 249 case ForwardButtonEndPart:
250 needLayoutObject = (buttonsPlacement == ScrollbarButtonsSingle || bu ttonsPlacement == ScrollbarButtonsDoubleEnd 250 needLayoutObject = (buttonsPlacement == ScrollbarButtonsPlacementSin gle || buttonsPlacement == ScrollbarButtonsPlacementDoubleEnd
251 || buttonsPlacement == ScrollbarButtonsDoubleBoth); 251 || buttonsPlacement == ScrollbarButtonsPlacementDoubleBoth);
252 break; 252 break;
253 default: 253 default:
254 break; 254 break;
255 } 255 }
256 } 256 }
257 257
258 LayoutScrollbarPart* partLayoutObject = m_parts.get(partType); 258 LayoutScrollbarPart* partLayoutObject = m_parts.get(partType);
259 if (!partLayoutObject && needLayoutObject) { 259 if (!partLayoutObject && needLayoutObject) {
260 partLayoutObject = LayoutScrollbarPart::createAnonymous(&owningLayoutObj ect()->document(), this, partType); 260 partLayoutObject = LayoutScrollbarPart::createAnonymous(&owningLayoutObj ect()->document(), this, partType);
261 m_parts.set(partType, partLayoutObject); 261 m_parts.set(partType, partLayoutObject);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 return; 362 return;
363 363
364 // FIXME: invalidate only the changed part. 364 // FIXME: invalidate only the changed part.
365 if (LayoutBox* owningLayoutObject = this->owningLayoutObject()) { 365 if (LayoutBox* owningLayoutObject = this->owningLayoutObject()) {
366 for (auto& part : m_parts) 366 for (auto& part : m_parts)
367 owningLayoutObject->invalidateDisplayItemClientForNonCompositingDesc endantsOf(*part.value); 367 owningLayoutObject->invalidateDisplayItemClientForNonCompositingDesc endantsOf(*part.value);
368 } 368 }
369 } 369 }
370 370
371 } 371 }
OLDNEW
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/platform/scroll/ScrollTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698