Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 bool ScrollbarGroup::scrollbarsCanBeActive() const | 258 bool ScrollbarGroup::scrollbarsCanBeActive() const |
| 259 { | 259 { |
| 260 return true; | 260 return true; |
| 261 } | 261 } |
| 262 | 262 |
| 263 bool ScrollbarGroup::userInputScrollable(ScrollbarOrientation orientation) const | 263 bool ScrollbarGroup::userInputScrollable(ScrollbarOrientation orientation) const |
| 264 { | 264 { |
| 265 return orientation == HorizontalScrollbar ? horizontalScrollbar() : vertical Scrollbar(); | 265 return orientation == HorizontalScrollbar ? horizontalScrollbar() : vertical Scrollbar(); |
| 266 } | 266 } |
| 267 | 267 |
| 268 bool ScrollbarGroup::shouldPlaceVerticalScrollbarOnLeft() const | |
| 269 { | |
| 270 return false; | |
|
jamesr
2013/09/06 22:46:56
interesting, i guess we never RTL-flip scrollbars
| |
| 271 } | |
| 272 | |
| 268 int ScrollbarGroup::pageStep(ScrollbarOrientation orientation) const | 273 int ScrollbarGroup::pageStep(ScrollbarOrientation orientation) const |
| 269 { | 274 { |
| 270 int length; | 275 int length; |
| 271 if (orientation == VerticalScrollbar) { | 276 if (orientation == VerticalScrollbar) { |
| 272 if (!m_verticalScrollbar) | 277 if (!m_verticalScrollbar) |
| 273 return 0; | 278 return 0; |
| 274 | 279 |
| 275 length = m_verticalScrollbar->scrollbar()->height(); | 280 length = m_verticalScrollbar->scrollbar()->height(); |
| 276 } else { | 281 } else { |
| 277 if (!m_horizontalScrollbar) | 282 if (!m_horizontalScrollbar) |
| 278 return 0; | 283 return 0; |
| 279 | 284 |
| 280 length = m_horizontalScrollbar->scrollbar()->width(); | 285 length = m_horizontalScrollbar->scrollbar()->width(); |
| 281 } | 286 } |
| 282 | 287 |
| 283 int pageStep = std::max( | 288 int pageStep = std::max( |
| 284 static_cast<int>(static_cast<float>(length) * ScrollableArea::minFractio nToStepWhenPaging()), | 289 static_cast<int>(static_cast<float>(length) * ScrollableArea::minFractio nToStepWhenPaging()), |
| 285 length - ScrollableArea::maxOverlapBetweenPages()); | 290 length - ScrollableArea::maxOverlapBetweenPages()); |
| 286 | 291 |
| 287 return std::max(pageStep, 1); | 292 return std::max(pageStep, 1); |
| 288 } | 293 } |
| 289 | 294 |
| 290 } // namespace WebKit | 295 } // namespace WebKit |
| OLD | NEW |