Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 // static | 338 int LayoutThemeDefault::scrollbarThicknessInDIP() const { |
| 339 int LayoutThemeDefault::scrollbarThicknessInDIP() { | 339 if (m_scrollbarThicknessInDIP > 0) |
|
keishi
2016/12/14 08:23:08
nit: Maybe initial value should be a negative valu
tkent
2016/12/14 08:49:40
AFAIK, getSize(WebThemeEngine::PartScrollbarUpArro
| |
| 340 return m_scrollbarThicknessInDIP; | |
| 340 int width = Platform::current() | 341 int width = Platform::current() |
| 341 ->themeEngine() | 342 ->themeEngine() |
| 342 ->getSize(WebThemeEngine::PartScrollbarUpArrow) | 343 ->getSize(WebThemeEngine::PartScrollbarUpArrow) |
| 343 .width; | 344 .width; |
| 344 return width > 0 ? width : 15; | 345 const_cast<LayoutThemeDefault*>(this)->m_scrollbarThicknessInDIP = |
| 346 width > 0 ? width : 15; | |
| 347 return m_scrollbarThicknessInDIP; | |
| 345 } | 348 } |
| 346 | 349 |
| 347 // static | |
| 348 float LayoutThemeDefault::clampedMenuListArrowPaddingSize( | 350 float LayoutThemeDefault::clampedMenuListArrowPaddingSize( |
| 349 const HostWindow* host, | 351 const HostWindow* host, |
| 350 const ComputedStyle& style) { | 352 const ComputedStyle& style) const { |
| 351 int originalSize = scrollbarThicknessInDIP(); | 353 int originalSize = scrollbarThicknessInDIP(); |
| 352 int scaledSize = | 354 int scaledSize = |
| 353 host ? host->windowToViewportScalar(originalSize) : originalSize; | 355 host ? host->windowToViewportScalar(originalSize) : originalSize; |
| 354 // 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 |
| 355 // secure space for scrollbar in popup. | 357 // secure space for scrollbar in popup. |
| 356 float deviceScale = 1.0f * scaledSize / originalSize; | 358 float deviceScale = 1.0f * scaledSize / originalSize; |
| 357 if (style.effectiveZoom() < deviceScale) | 359 if (style.effectiveZoom() < deviceScale) |
| 358 return scaledSize; | 360 return scaledSize; |
| 359 // 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. |
| 360 // crbug.com/432795. | 362 // crbug.com/432795. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 382 double LayoutThemeDefault::animationRepeatIntervalForProgressBar() const { | 384 double LayoutThemeDefault::animationRepeatIntervalForProgressBar() const { |
| 383 return progressAnimationInterval; | 385 return progressAnimationInterval; |
| 384 } | 386 } |
| 385 | 387 |
| 386 double LayoutThemeDefault::animationDurationForProgressBar() const { | 388 double LayoutThemeDefault::animationDurationForProgressBar() const { |
| 387 return progressAnimationInterval * progressAnimationFrames * | 389 return progressAnimationInterval * progressAnimationFrames * |
| 388 2; // "2" for back and forth | 390 2; // "2" for back and forth |
| 389 } | 391 } |
| 390 | 392 |
| 391 } // namespace blink | 393 } // namespace blink |
| OLD | NEW |