root/ui/views/controls/scrollbar/scroll_bar.cc

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. GetAccessibleState
  2. IsHorizontal
  3. Update
  4. GetMaxPosition
  5. GetMinPosition
  6. GetContentOverlapSize
  7. OnMouseEnteredScrollView
  8. OnMouseExitedScrollView
  9. max_pos_

// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/controls/scrollbar/scroll_bar.h"

#include "ui/accessibility/ax_view_state.h"

namespace views {

ScrollBar::~ScrollBar() {
}

void ScrollBar::GetAccessibleState(ui::AXViewState* state) {
  state->role = ui::AX_ROLE_SCROLL_BAR;
}

bool ScrollBar::IsHorizontal() const {
  return is_horiz_;
}

void ScrollBar::Update(int viewport_size, int content_size, int current_pos) {
  max_pos_ = std::max(0, content_size - viewport_size);
}

int ScrollBar::GetMaxPosition() const {
  return max_pos_;
}

int ScrollBar::GetMinPosition() const {
  return 0;
}

int ScrollBar::GetContentOverlapSize() const {
  return 0;
}

void ScrollBar::OnMouseEnteredScrollView(const ui::MouseEvent& event) {
}

void ScrollBar::OnMouseExitedScrollView(const ui::MouseEvent& event) {
}

ScrollBar::ScrollBar(bool is_horiz)
    : is_horiz_(is_horiz),
      controller_(NULL),
      max_pos_(0) {
}

}  // namespace views

/* [<][>][^][v][top][bottom][index][help] */