| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "views/controls/scrollbar/native_scroll_bar_win.h" | 5 #include "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 "app/win/window_impl.h" |
| 10 #include "base/keyboard_codes.h" | 11 #include "base/keyboard_codes.h" |
| 11 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 12 #include "base/window_impl.h" | |
| 13 #include "views/controls/scrollbar/native_scroll_bar.h" | 13 #include "views/controls/scrollbar/native_scroll_bar.h" |
| 14 #include "views/controls/scrollbar/scroll_bar.h" | 14 #include "views/controls/scrollbar/scroll_bar.h" |
| 15 #include "views/widget/widget.h" | 15 #include "views/widget/widget.h" |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 | 18 |
| 19 ///////////////////////////////////////////////////////////////////////////// | 19 ///////////////////////////////////////////////////////////////////////////// |
| 20 // | 20 // |
| 21 // ScrollBarContainer | 21 // ScrollBarContainer |
| 22 // | 22 // |
| 23 // Since windows scrollbars only send notifications to their parent hwnd, we | 23 // Since windows scrollbars only send notifications to their parent hwnd, we |
| 24 // use instances of this class to wrap native scrollbars. | 24 // use instances of this class to wrap native scrollbars. |
| 25 // | 25 // |
| 26 ///////////////////////////////////////////////////////////////////////////// | 26 ///////////////////////////////////////////////////////////////////////////// |
| 27 class ScrollBarContainer : public base::WindowImpl { | 27 class ScrollBarContainer : public app::WindowImpl { |
| 28 public: | 28 public: |
| 29 explicit ScrollBarContainer(ScrollBar* parent) | 29 explicit ScrollBarContainer(ScrollBar* parent) |
| 30 : parent_(parent), | 30 : parent_(parent), |
| 31 scrollbar_(NULL) { | 31 scrollbar_(NULL) { |
| 32 set_window_style(WS_CHILD); | 32 set_window_style(WS_CHILD); |
| 33 Init(parent->GetWidget()->GetNativeView(), gfx::Rect()); | 33 Init(parent->GetWidget()->GetNativeView(), gfx::Rect()); |
| 34 ShowWindow(hwnd(), SW_SHOW); | 34 ShowWindow(hwnd(), SW_SHOW); |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual ~ScrollBarContainer() { | 37 virtual ~ScrollBarContainer() { |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return GetSystemMetrics(SM_CYHSCROLL); | 338 return GetSystemMetrics(SM_CYHSCROLL); |
| 339 } | 339 } |
| 340 | 340 |
| 341 // static | 341 // static |
| 342 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { | 342 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { |
| 343 return GetSystemMetrics(SM_CXVSCROLL); | 343 return GetSystemMetrics(SM_CXVSCROLL); |
| 344 } | 344 } |
| 345 | 345 |
| 346 } // namespace views | 346 } // namespace views |
| 347 | 347 |
| OLD | NEW |