OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/controls/scrollbar/native_scroll_bar_win.h" | 5 #include "ui/views/controls/scrollbar/native_scroll_bar_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 if (code != -1) { | 264 if (code != -1) { |
265 SendMessage(sb_container_->hwnd(), | 265 SendMessage(sb_container_->hwnd(), |
266 native_scroll_bar_->IsHorizontal() ? WM_HSCROLL : WM_VSCROLL, | 266 native_scroll_bar_->IsHorizontal() ? WM_HSCROLL : WM_VSCROLL, |
267 MAKELONG(static_cast<WORD>(code), 0), 0L); | 267 MAKELONG(static_cast<WORD>(code), 0), 0L); |
268 return true; | 268 return true; |
269 } | 269 } |
270 return false; | 270 return false; |
271 } | 271 } |
272 | 272 |
273 bool NativeScrollBarWin::OnMouseWheel(const MouseWheelEvent& e) { | 273 bool NativeScrollBarWin::OnMouseWheel(const ui::MouseWheelEvent& e) { |
274 if (!sb_container_.get()) | 274 if (!sb_container_.get()) |
275 return false; | 275 return false; |
276 sb_container_->ScrollWithOffset(e.offset()); | 276 sb_container_->ScrollWithOffset(e.offset()); |
277 return true; | 277 return true; |
278 } | 278 } |
279 | 279 |
280 //////////////////////////////////////////////////////////////////////////////// | 280 //////////////////////////////////////////////////////////////////////////////// |
281 // NativeScrollBarWin, NativeControlWin overrides: | 281 // NativeScrollBarWin, NativeControlWin overrides: |
282 | 282 |
283 void NativeScrollBarWin::CreateNativeControl() { | 283 void NativeScrollBarWin::CreateNativeControl() { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() { | 341 int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() { |
342 return GetSystemMetrics(SM_CYHSCROLL); | 342 return GetSystemMetrics(SM_CYHSCROLL); |
343 } | 343 } |
344 | 344 |
345 // static | 345 // static |
346 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { | 346 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { |
347 return GetSystemMetrics(SM_CXVSCROLL); | 347 return GetSystemMetrics(SM_CXVSCROLL); |
348 } | 348 } |
349 | 349 |
350 } // namespace views | 350 } // namespace views |
OLD | NEW |