| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/keyboard_codes.h" | 10 #include "app/keyboard_codes.h" | 
|  | 11 #include "app/win/window_impl.h" | 
| 11 #include "base/message_loop.h" | 12 #include "base/message_loop.h" | 
| 12 #include "gfx/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 gfx::WindowImpl { | 27 class ScrollBarContainer : public app::win::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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 340 int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() { | 340 int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() { | 
| 341   return GetSystemMetrics(SM_CYHSCROLL); | 341   return GetSystemMetrics(SM_CYHSCROLL); | 
| 342 } | 342 } | 
| 343 | 343 | 
| 344 // static | 344 // static | 
| 345 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { | 345 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { | 
| 346   return GetSystemMetrics(SM_CXVSCROLL); | 346   return GetSystemMetrics(SM_CXVSCROLL); | 
| 347 } | 347 } | 
| 348 | 348 | 
| 349 }  // namespace views | 349 }  // namespace views | 
| OLD | NEW | 
|---|