Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ui / message_center / views / bounded_scroll_view.h
1 // Copyright 2014 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 UI_MESSAGE_CENTER_VIEWS_BOUNDED_SCROLL_VIEW_H_
6 #define UI_MESSAGE_CENTER_VIEWS_BOUNDED_SCROLL_VIEW_H_
7
8 #include "ui/gfx/size.h"
9 #include "ui/message_center/message_center_export.h"
10 #include "ui/views/controls/scroll_view.h"
11
12 namespace message_center {
13
14 // A custom scroll view whose height has a minimum and maximum value and whose
15 // scroll bar disappears when not needed.
16 class MESSAGE_CENTER_EXPORT BoundedScrollView : public views::ScrollView {
17  public:
18   BoundedScrollView(int min_height, int max_height);
19
20   // Overridden from views::View:
21   virtual gfx::Size GetPreferredSize() OVERRIDE;
22   virtual int GetHeightForWidth(int width) OVERRIDE;
23   virtual void Layout() OVERRIDE;
24
25  private:
26   int min_height_;
27   int max_height_;
28
29   DISALLOW_COPY_AND_ASSIGN(BoundedScrollView);
30 };
31
32 }  // namespace message_center
33
34 #endif  // UI_MESSAGE_CENTER_VIEWS_BOUNDED_SCROLL_VIEW_H_