Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Side by Side Diff: views/controls/scrollbar/native_scroll_bar_views.h

Issue 7669028: Adding a Views scrollbar implementation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Refactored the bitmap code to be shared with the native_scroll_bar_views Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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 #ifndef VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_
6 #define VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_
7 #pragma once
8
9 #include "ui/gfx/native_theme.h"
10 #include "ui/gfx/point.h"
11 #include "views/controls/button/button.h"
12 #include "views/controls/scrollbar/base_scroll_bar.h"
13 #include "views/controls/scrollbar/native_scroll_bar_wrapper.h"
14 #include "views/view.h"
15
16 namespace gfx {
17 class Canvas;
18 }
19
20 namespace views {
21
22 class NativeScrollBar;
23
24 // Views implementation for the scrollbar.
25 class NativeScrollBarViews : public BaseScrollBar,
26 public ButtonListener,
27 public NativeScrollBarWrapper {
28 public:
29 // Creates new scrollbar, either horizontal or vertical.
30 explicit NativeScrollBarViews(NativeScrollBar* native_scroll_bar);
31 virtual ~NativeScrollBarViews();
32
33 private:
34 // Overridden from View for layout purpose.
Ben Goodger (Google) 2011/08/23 16:05:15 View overrides:
35 virtual void Layout();
36 virtual gfx::Size GetPreferredSize();
37
38 // ScrollBar overrides:
39 virtual int GetLayoutSize() const OVERRIDE;
40
41 // BaseScrollBar overrides:
42 virtual void ScrollToPosition(int position);
43 virtual int GetScrollIncrement(bool is_page, bool is_positive);
44
45 // Overridden from View.
Ben Goodger (Google) 2011/08/23 16:05:15 Move adjacent to other View overrides, and update
46 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
47
48 // BaseButton::ButtonListener overrides:
49 virtual void ButtonPressed(Button* sender,
50 const views::Event& event) OVERRIDE;
51
52 // Overridden from NativeScrollBarWrapper.
Ben Goodger (Google) 2011/08/23 16:05:15 Change comment style to match the other section he
53 virtual int GetPosition() const;
54 virtual View* GetView();
55 virtual void Update(int viewport_size, int content_size, int current_pos);
56
57 // Returns the area for the track. This is the area of the scrollbar minus
58 // the size of the arrow buttons.
59 gfx::Rect GetTrackBounds() const;
60
61 // The NativeScrollBar we are bound to.
62 NativeScrollBar* native_scroll_bar_;
63
64 // The scroll bar buttons (Up/Down, Left/Right).
65 Button* prev_button_;
66 Button* next_button_;
67
68 gfx::NativeTheme::ExtraParams params_;
69 gfx::NativeTheme::Part part_;
70 gfx::NativeTheme::State state_;
71
72 DISALLOW_COPY_AND_ASSIGN(NativeScrollBarViews);
73 };
74
75 } // namespace views
76
77 #endif // #ifndef VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_
78
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698