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
3 // found in the LICENSE file.
5 #include "ui/views/controls/scrollbar/scroll_bar.h"
7 #include "ui/accessibility/ax_view_state.h"
11 ScrollBar::~ScrollBar() {
14 void ScrollBar::GetAccessibleState(ui::AXViewState
* state
) {
15 state
->role
= ui::AX_ROLE_SCROLL_BAR
;
18 bool ScrollBar::IsHorizontal() const {
22 void ScrollBar::Update(int viewport_size
, int content_size
, int current_pos
) {
23 max_pos_
= std::max(0, content_size
- viewport_size
);
26 int ScrollBar::GetMaxPosition() const {
30 int ScrollBar::GetMinPosition() const {
34 int ScrollBar::GetContentOverlapSize() const {
38 void ScrollBar::OnMouseEnteredScrollView(const ui::MouseEvent
& event
) {
41 void ScrollBar::OnMouseExitedScrollView(const ui::MouseEvent
& event
) {
44 ScrollBar::ScrollBar(bool is_horiz
)
45 : is_horiz_(is_horiz
),