| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 /* [in] */ RECT bounds) | 136 /* [in] */ RECT bounds) |
| 137 { | 137 { |
| 138 IntRect rect(bounds.left, bounds.top, bounds.right-bounds.left, bounds.botto
m-bounds.top); | 138 IntRect rect(bounds.left, bounds.top, bounds.right-bounds.left, bounds.botto
m-bounds.top); |
| 139 m_scrollBar->setFrameRect(rect); | 139 m_scrollBar->setFrameRect(rect); |
| 140 return S_OK; | 140 return S_OK; |
| 141 } | 141 } |
| 142 | 142 |
| 143 HRESULT STDMETHODCALLTYPE WebScrollBar::setValue( | 143 HRESULT STDMETHODCALLTYPE WebScrollBar::setValue( |
| 144 /* [in] */ int value) | 144 /* [in] */ int value) |
| 145 { | 145 { |
| 146 m_scrollBar->setValue(value); | 146 m_scrollBar->setValue(value, Scrollbar::NotFromScrollAnimator); |
| 147 return S_OK; | 147 return S_OK; |
| 148 } | 148 } |
| 149 | 149 |
| 150 HRESULT STDMETHODCALLTYPE WebScrollBar::value( | 150 HRESULT STDMETHODCALLTYPE WebScrollBar::value( |
| 151 /* [retval][out] */ int* value) | 151 /* [retval][out] */ int* value) |
| 152 { | 152 { |
| 153 if (!value) | 153 if (!value) |
| 154 return E_POINTER; | 154 return E_POINTER; |
| 155 *value = m_scrollBar->value(); | 155 *value = m_scrollBar->value(); |
| 156 return S_OK; | 156 return S_OK; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 WebScrollGranularity granularity, | 245 WebScrollGranularity granularity, |
| 246 float multiplier) | 246 float multiplier) |
| 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 |
| 256 { |
| 257 return (orientation == m_scrollBar->orientation()) ? (m_scrollbar->totalSize
() - m_scrollbar->visibleSize()) : 0; |
| 258 } |
| 259 |
| 260 void WebScrollBar::setScrollOffsetFromAnimation(const IntPoint&) |
| 261 { |
| 262 m_scrollbar->setValue((m_scrollBar->orientation() == HorizontalScrollbar) ?
offset.x() : offset.y(), Scrollbar::FromScrollAnimator); |
| 263 } |
| 264 |
| 255 void WebScrollBar::valueChanged(Scrollbar* scrollBar) | 265 void WebScrollBar::valueChanged(Scrollbar* scrollBar) |
| 256 { | 266 { |
| 257 if (m_scrollBar != scrollBar) { | 267 if (m_scrollBar != scrollBar) { |
| 258 ASSERT(false); // shouldn't happen | 268 ASSERT(false); // shouldn't happen |
| 259 return; | 269 return; |
| 260 } | 270 } |
| 261 m_delegate->valueChanged(this); | 271 m_delegate->valueChanged(this); |
| 262 } | 272 } |
| 263 | 273 |
| 264 void WebScrollBar::invalidateScrollbarRect(Scrollbar*, const IntRect& rect) | 274 void WebScrollBar::invalidateScrollbarRect(Scrollbar*, const IntRect& rect) |
| 265 { | 275 { |
| 266 RECT r = rect; | 276 RECT r = rect; |
| 267 ::InvalidateRect(m_containingWindow, &r, false); | 277 ::InvalidateRect(m_containingWindow, &r, false); |
| 268 } | 278 } |
| OLD | NEW |