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.h" | 5 #include "ui/views/controls/scrollbar/native_scroll_bar.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 | 36 |
37 // static | 37 // static |
38 int NativeScrollBar::GetVerticalScrollBarWidth( | 38 int NativeScrollBar::GetVerticalScrollBarWidth( |
39 const ui::NativeTheme* theme) { | 39 const ui::NativeTheme* theme) { |
40 return NativeScrollBarWrapper::GetVerticalScrollBarWidth(theme); | 40 return NativeScrollBarWrapper::GetVerticalScrollBarWidth(theme); |
41 } | 41 } |
42 | 42 |
43 //////////////////////////////////////////////////////////////////////////////// | 43 //////////////////////////////////////////////////////////////////////////////// |
44 // NativeScrollBar, View overrides: | 44 // NativeScrollBar, View overrides: |
45 gfx::Size NativeScrollBar::GetPreferredSize() { | 45 gfx::Size NativeScrollBar::GetPreferredSize() const { |
46 if (native_wrapper_) | 46 if (native_wrapper_) |
47 return native_wrapper_->GetView()->GetPreferredSize(); | 47 return native_wrapper_->GetView()->GetPreferredSize(); |
48 return gfx::Size(); | 48 return gfx::Size(); |
49 } | 49 } |
50 | 50 |
51 void NativeScrollBar::Layout() { | 51 void NativeScrollBar::Layout() { |
52 if (native_wrapper_) { | 52 if (native_wrapper_) { |
53 native_wrapper_->GetView()->SetBounds(0, 0, width(), height()); | 53 native_wrapper_->GetView()->SetBounds(0, 0, width(), height()); |
54 native_wrapper_->GetView()->Layout(); | 54 native_wrapper_->GetView()->Layout(); |
55 } | 55 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 | 106 |
107 int NativeScrollBar::GetPosition() const { | 107 int NativeScrollBar::GetPosition() const { |
108 if (!native_wrapper_) | 108 if (!native_wrapper_) |
109 return 0; | 109 return 0; |
110 return native_wrapper_->GetPosition(); | 110 return native_wrapper_->GetPosition(); |
111 } | 111 } |
112 | 112 |
113 } // namespace views | 113 } // namespace views |
114 | 114 |
OLD | NEW |