OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_views.h" | 5 #include "views/controls/scrollbar/native_scroll_bar_views.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/keycodes/keyboard_codes.h" | 8 #include "ui/base/keycodes/keyboard_codes.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/gfx/canvas_skia.h" | 10 #include "ui/gfx/canvas_skia.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 bounds.set_height(thumb->GetPreferredSize().height()); | 377 bounds.set_height(thumb->GetPreferredSize().height()); |
378 } else { | 378 } else { |
379 bounds.set_y(bounds.y() + size.height()); | 379 bounds.set_y(bounds.y() + size.height()); |
380 bounds.set_height(std::max(0, bounds.height() - 2 * size.height())); | 380 bounds.set_height(std::max(0, bounds.height() - 2 * size.height())); |
381 bounds.set_width(thumb->GetPreferredSize().width()); | 381 bounds.set_width(thumb->GetPreferredSize().width()); |
382 } | 382 } |
383 | 383 |
384 return bounds; | 384 return bounds; |
385 } | 385 } |
386 | 386 |
| 387 #if !defined(TOOLKIT_USES_GTK) |
| 388 //////////////////////////////////////////////////////////////////////////////// |
| 389 // NativewScrollBarWrapper, public: |
| 390 |
| 391 // static |
| 392 NativeScrollBarWrapper* NativeScrollBarWrapper::CreateWrapper( |
| 393 NativeScrollBar* scroll_bar) { |
| 394 return new NativeScrollBarViews(scroll_bar); |
| 395 } |
| 396 |
| 397 // static |
| 398 int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() { |
| 399 return 20; |
| 400 } |
| 401 |
| 402 // static |
| 403 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { |
| 404 return 20; |
| 405 } |
| 406 #endif |
| 407 |
387 } // namespace views | 408 } // namespace views |
OLD | NEW |