| 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 "ui/views/controls/scrollbar/scroll_bar.h" | 5 #include "ui/views/controls/scrollbar/scroll_bar.h" |
| 6 | 6 |
| 7 #include "ui/accessibility/ax_view_state.h" | 7 #include "ui/accessibility/ax_node_data.h" |
| 8 | 8 |
| 9 namespace views { | 9 namespace views { |
| 10 | 10 |
| 11 ScrollBar::~ScrollBar() { | 11 ScrollBar::~ScrollBar() { |
| 12 } | 12 } |
| 13 | 13 |
| 14 void ScrollBar::GetAccessibleState(ui::AXViewState* state) { | 14 void ScrollBar::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 15 state->role = ui::AX_ROLE_SCROLL_BAR; | 15 node_data->role = ui::AX_ROLE_SCROLL_BAR; |
| 16 } | 16 } |
| 17 | 17 |
| 18 bool ScrollBar::IsHorizontal() const { | 18 bool ScrollBar::IsHorizontal() const { |
| 19 return is_horiz_; | 19 return is_horiz_; |
| 20 } | 20 } |
| 21 | 21 |
| 22 void ScrollBar::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); | 23 max_pos_ = std::max(0, content_size - viewport_size); |
| 24 } | 24 } |
| 25 | 25 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 41 void ScrollBar::OnMouseExitedScrollView(const ui::MouseEvent& event) { | 41 void ScrollBar::OnMouseExitedScrollView(const ui::MouseEvent& event) { |
| 42 } | 42 } |
| 43 | 43 |
| 44 ScrollBar::ScrollBar(bool is_horiz) | 44 ScrollBar::ScrollBar(bool is_horiz) |
| 45 : is_horiz_(is_horiz), | 45 : is_horiz_(is_horiz), |
| 46 controller_(NULL), | 46 controller_(NULL), |
| 47 max_pos_(0) { | 47 max_pos_(0) { |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace views | 50 } // namespace views |
| OLD | NEW |