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.
5 #ifndef UI_MESSAGE_CENTER_VIEWS_BOUNDED_SCROLL_VIEW_H_
6 #define UI_MESSAGE_CENTER_VIEWS_BOUNDED_SCROLL_VIEW_H_
8 #include "ui/gfx/size.h"
9 #include "ui/message_center/message_center_export.h"
10 #include "ui/views/controls/scroll_view.h"
12 namespace message_center {
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 {
18 BoundedScrollView(int min_height, int max_height);
20 // Overridden from views::View:
21 virtual gfx::Size GetPreferredSize() OVERRIDE;
22 virtual int GetHeightForWidth(int width) OVERRIDE;
23 virtual void Layout() OVERRIDE;
29 DISALLOW_COPY_AND_ASSIGN(BoundedScrollView);
32 } // namespace message_center
34 #endif // UI_MESSAGE_CENTER_VIEWS_BOUNDED_SCROLL_VIEW_H_