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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp

Issue 2579663002: Update comments about scrollbar thickness. (Closed)
Patch Set: _ Created 4 years 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) 2007 Apple Inc. 2 * Copyright (C) 2007 Apple Inc.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2008 Collabora Ltd. 4 * Copyright (C) 2008 Collabora Ltd.
5 * Copyright (C) 2008, 2009 Google Inc. 5 * Copyright (C) 2008, 2009 Google Inc.
6 * Copyright (C) 2009 Kenneth Rohde Christiansen 6 * Copyright (C) 2009 Kenneth Rohde Christiansen
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 int LayoutThemeDefault::popupInternalPaddingTop( 328 int LayoutThemeDefault::popupInternalPaddingTop(
329 const ComputedStyle& style) const { 329 const ComputedStyle& style) const {
330 return menuListInternalPadding(style, 1); 330 return menuListInternalPadding(style, 1);
331 } 331 }
332 332
333 int LayoutThemeDefault::popupInternalPaddingBottom( 333 int LayoutThemeDefault::popupInternalPaddingBottom(
334 const ComputedStyle& style) const { 334 const ComputedStyle& style) const {
335 return menuListInternalPadding(style, 1); 335 return menuListInternalPadding(style, 1);
336 } 336 }
337 337
338 int LayoutThemeDefault::scrollbarThicknessInDIP() const { 338 int LayoutThemeDefault::menuListArrowWidthInDIP() const {
339 if (m_scrollbarThicknessInDIP > 0) 339 if (m_menuListArrowWidthInDIP > 0)
340 return m_scrollbarThicknessInDIP; 340 return m_menuListArrowWidthInDIP;
341 int width = Platform::current() 341 int width = Platform::current()
342 ->themeEngine() 342 ->themeEngine()
343 ->getSize(WebThemeEngine::PartScrollbarUpArrow) 343 ->getSize(WebThemeEngine::PartScrollbarUpArrow)
344 .width; 344 .width;
345 const_cast<LayoutThemeDefault*>(this)->m_scrollbarThicknessInDIP = 345 const_cast<LayoutThemeDefault*>(this)->m_menuListArrowWidthInDIP =
346 width > 0 ? width : 15; 346 width > 0 ? width : 15;
347 return m_scrollbarThicknessInDIP; 347 return m_menuListArrowWidthInDIP;
348 } 348 }
349 349
350 float LayoutThemeDefault::clampedMenuListArrowPaddingSize( 350 float LayoutThemeDefault::clampedMenuListArrowPaddingSize(
351 const HostWindow* host, 351 const HostWindow* host,
352 const ComputedStyle& style) const { 352 const ComputedStyle& style) const {
353 int originalSize = scrollbarThicknessInDIP(); 353 int originalSize = menuListArrowWidthInDIP();
354 int scaledSize = 354 int scaledSize =
355 host ? host->windowToViewportScalar(originalSize) : originalSize; 355 host ? host->windowToViewportScalar(originalSize) : originalSize;
356 // The result should not be samller than the scrollbar thickness in order to 356 // The result should not be samller than the scrollbar thickness in order to
357 // secure space for scrollbar in popup. 357 // secure space for scrollbar in popup.
358 float deviceScale = 1.0f * scaledSize / originalSize; 358 float deviceScale = 1.0f * scaledSize / originalSize;
359 if (style.effectiveZoom() < deviceScale) 359 if (style.effectiveZoom() < deviceScale)
360 return scaledSize; 360 return scaledSize;
361 // The value should be zoomed though scrollbars aren't scaled by zoom. 361 // The value should be zoomed though scrollbars aren't scaled by zoom.
362 // crbug.com/432795. 362 // crbug.com/432795.
363 return originalSize * style.effectiveZoom(); 363 return originalSize * style.effectiveZoom();
(...skipping 20 matching lines...) Expand all
384 double LayoutThemeDefault::animationRepeatIntervalForProgressBar() const { 384 double LayoutThemeDefault::animationRepeatIntervalForProgressBar() const {
385 return progressAnimationInterval; 385 return progressAnimationInterval;
386 } 386 }
387 387
388 double LayoutThemeDefault::animationDurationForProgressBar() const { 388 double LayoutThemeDefault::animationDurationForProgressBar() const {
389 return progressAnimationInterval * progressAnimationFrames * 389 return progressAnimationInterval * progressAnimationFrames *
390 2; // "2" for back and forth 390 2; // "2" for back and forth
391 } 391 }
392 392
393 } // namespace blink 393 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698