• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #include "ui/views/controls/scrollbar/scroll_bar.h"
6 
7 #include "ui/base/accessibility/accessible_view_state.h"
8 
9 namespace views {
10 
~ScrollBar()11 ScrollBar::~ScrollBar() {
12 }
13 
GetAccessibleState(ui::AccessibleViewState * state)14 void ScrollBar::GetAccessibleState(ui::AccessibleViewState* state) {
15   state->role = ui::AccessibilityTypes::ROLE_SCROLLBAR;
16 }
17 
IsHorizontal() const18 bool ScrollBar::IsHorizontal() const {
19   return is_horiz_;
20 }
21 
Update(int viewport_size,int content_size,int current_pos)22 void ScrollBar::Update(int viewport_size, int content_size, int current_pos) {
23   max_pos_ = std::max(0, content_size - viewport_size);
24 }
25 
GetMaxPosition() const26 int ScrollBar::GetMaxPosition() const {
27   return max_pos_;
28 }
29 
GetMinPosition() const30 int ScrollBar::GetMinPosition() const {
31   return 0;
32 }
33 
GetContentOverlapSize() const34 int ScrollBar::GetContentOverlapSize() const {
35   return 0;
36 }
37 
OnMouseEnteredScrollView(const ui::MouseEvent & event)38 void ScrollBar::OnMouseEnteredScrollView(const ui::MouseEvent& event) {
39 }
40 
OnMouseExitedScrollView(const ui::MouseEvent & event)41 void ScrollBar::OnMouseExitedScrollView(const ui::MouseEvent& event) {
42 }
43 
ScrollBar(bool is_horiz)44 ScrollBar::ScrollBar(bool is_horiz)
45     : is_horiz_(is_horiz),
46       controller_(NULL),
47       max_pos_(0) {
48 }
49 
50 }  // namespace views
51