summaryrefslogtreecommitdiffstats
path: root/views/controls/scrollbar/native_scroll_bar_wrapper.h
blob: fb92c3d5afc1f0b56b5bb4f6351ba6900b871f44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2010 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.

#ifndef VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_
#define VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_
#pragma once

namespace views {

class NativeScrollBar;
class View;

// A specialization of NativeControlWrapper that hosts a platform-native
// scroll bar.
class NativeScrollBarWrapper {
 public:
  virtual ~NativeScrollBarWrapper() {}

  // Updates the scroll bar appearance given a viewport size, content size and
  // current position.
  virtual void Update(int viewport_size, int content_size, int current_pos) = 0;

  // Retrieves the views::View that hosts the native control.
  virtual View* GetView() = 0;

  // Returns the position of the scrollbar.
  virtual int GetPosition() const = 0;

  // Creates an appropriate NativeScrollBarWrapper for the platform.
  static NativeScrollBarWrapper* CreateWrapper(NativeScrollBar* button);

  // Returns the system sizes of vertical/horizontal scroll bars.
  static int GetVerticalScrollBarWidth();
  static int GetHorizontalScrollBarHeight();
};

}  // namespace views

#endif  // VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_