OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 { | 247 { |
248 ScrollDirection webCoreScrollDirection = (ScrollDirection) direction; | 248 ScrollDirection webCoreScrollDirection = (ScrollDirection) direction; |
249 ScrollGranularity webCoreGranularity = (ScrollGranularity) granularity; | 249 ScrollGranularity webCoreGranularity = (ScrollGranularity) granularity; |
250 m_scrollBar->scroll(webCoreScrollDirection, webCoreGranularity, multiplier); | 250 m_scrollBar->scroll(webCoreScrollDirection, webCoreGranularity, multiplier); |
251 return S_OK; | 251 return S_OK; |
252 } | 252 } |
253 | 253 |
254 // ScrollbarClient ------------------------------------------------------- | 254 // ScrollbarClient ------------------------------------------------------- |
255 int WebScrollBar::scrollSize(ScrollbarOrientation orientation) const | 255 int WebScrollBar::scrollSize(ScrollbarOrientation orientation) const |
256 { | 256 { |
257 return (orientation == m_scrollBar->orientation()) ? (m_scrollbar->totalSize
() - m_scrollbar->visibleSize()) : 0; | 257 return (orientation == m_scrollBar->orientation()) ? (m_scrollBar->totalSize
() - m_scrollBar->visibleSize()) : 0; |
258 } | 258 } |
259 | 259 |
260 void WebScrollBar::setScrollOffsetFromAnimation(const IntPoint&) | 260 void WebScrollBar::setScrollOffsetFromAnimation(const IntPoint&) |
261 { | 261 { |
262 m_scrollbar->setValue((m_scrollBar->orientation() == HorizontalScrollbar) ?
offset.x() : offset.y(), Scrollbar::FromScrollAnimator); | 262 m_scrollBar->setValue((m_scrollBar->orientation() == HorizontalScrollbar) ?
offset.x() : offset.y(), Scrollbar::FromScrollAnimator); |
263 } | 263 } |
264 | 264 |
265 void WebScrollBar::valueChanged(Scrollbar* scrollBar) | 265 void WebScrollBar::valueChanged(Scrollbar* scrollBar) |
266 { | 266 { |
267 if (m_scrollBar != scrollBar) { | 267 if (m_scrollBar != scrollBar) { |
268 ASSERT(false); // shouldn't happen | 268 ASSERT(false); // shouldn't happen |
269 return; | 269 return; |
270 } | 270 } |
271 m_delegate->valueChanged(this); | 271 m_delegate->valueChanged(this); |
272 } | 272 } |
273 | 273 |
274 void WebScrollBar::invalidateScrollbarRect(Scrollbar*, const IntRect& rect) | 274 void WebScrollBar::invalidateScrollbarRect(Scrollbar*, const IntRect& rect) |
275 { | 275 { |
276 RECT r = rect; | 276 RECT r = rect; |
277 ::InvalidateRect(m_containingWindow, &r, false); | 277 ::InvalidateRect(m_containingWindow, &r, false); |
278 } | 278 } |
OLD | NEW |