| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/views/native_scroll_bar.h" | 5 #include "chrome/views/native_scroll_bar.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlapp.h> | 9 #include <atlapp.h> |
| 10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 if (sb_view_) | 241 if (sb_view_) |
| 242 sb_view_->SetBounds(GetLocalBounds(true)); | 242 sb_view_->SetBounds(GetLocalBounds(true)); |
| 243 } | 243 } |
| 244 | 244 |
| 245 gfx::Size NativeScrollBar::GetPreferredSize() { | 245 gfx::Size NativeScrollBar::GetPreferredSize() { |
| 246 if (IsHorizontal()) | 246 if (IsHorizontal()) |
| 247 return gfx::Size(0, GetLayoutSize()); | 247 return gfx::Size(0, GetLayoutSize()); |
| 248 return gfx::Size(GetLayoutSize(), 0); | 248 return gfx::Size(GetLayoutSize(), 0); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void NativeScrollBar::Update(int viewport_size, int content_size, int current_po
s) { | 251 void NativeScrollBar::Update(int viewport_size, |
| 252 int content_size, |
| 253 int current_pos) { |
| 252 ScrollBar::Update(viewport_size, content_size, current_pos); | 254 ScrollBar::Update(viewport_size, content_size, current_pos); |
| 253 if (!sb_container_) | 255 if (!sb_container_) |
| 254 return; | 256 return; |
| 255 | 257 |
| 256 if (content_size < 0) | 258 if (content_size < 0) |
| 257 content_size = 0; | 259 content_size = 0; |
| 258 | 260 |
| 259 if (current_pos < 0) | 261 if (current_pos < 0) |
| 260 current_pos = 0; | 262 current_pos = 0; |
| 261 | 263 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 return ::GetSystemMetrics(SM_CYHSCROLL); | 347 return ::GetSystemMetrics(SM_CYHSCROLL); |
| 346 } | 348 } |
| 347 | 349 |
| 348 //static | 350 //static |
| 349 int NativeScrollBar::GetVerticalScrollBarWidth() { | 351 int NativeScrollBar::GetVerticalScrollBarWidth() { |
| 350 return ::GetSystemMetrics(SM_CXVSCROLL); | 352 return ::GetSystemMetrics(SM_CXVSCROLL); |
| 351 } | 353 } |
| 352 | 354 |
| 353 } // namespace views | 355 } // namespace views |
| 354 | 356 |
| OLD | NEW |