OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ |
7 | 7 |
8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
9 #include "ui/views/bubble/bubble_border.h" | 9 #include "ui/views/bubble/bubble_border.h" |
10 #include "ui/views/controls/menu/menu_item_view.h" | 10 #include "ui/views/controls/menu/menu_types.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 | 13 |
14 class SubmenuView; | 14 class SubmenuView; |
15 | 15 |
16 // MenuScrollViewContainer contains the SubmenuView (through a MenuScrollView) | 16 // MenuScrollViewContainer contains the SubmenuView (through a MenuScrollView) |
17 // and two scroll buttons. The scroll buttons are only visible and enabled if | 17 // and two scroll buttons. The scroll buttons are only visible and enabled if |
18 // the preferred height of the SubmenuView is bigger than our bounds. | 18 // the preferred height of the SubmenuView is bigger than our bounds. |
19 class MenuScrollViewContainer : public View { | 19 class MenuScrollViewContainer : public View { |
20 public: | 20 public: |
(...skipping 19 matching lines...) Expand all Loading... |
40 // View override. | 40 // View override. |
41 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 41 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
42 | 42 |
43 private: | 43 private: |
44 // Create the default border. | 44 // Create the default border. |
45 void CreateDefaultBorder(); | 45 void CreateDefaultBorder(); |
46 | 46 |
47 // Create the bubble border. | 47 // Create the bubble border. |
48 void CreateBubbleBorder(); | 48 void CreateBubbleBorder(); |
49 | 49 |
50 BubbleBorder::Arrow BubbleBorderTypeFromAnchor( | 50 BubbleBorder::Arrow BubbleBorderTypeFromAnchor(MenuAnchorPosition anchor); |
51 MenuItemView::AnchorPosition anchor); | |
52 | 51 |
53 class MenuScrollView; | 52 class MenuScrollView; |
54 | 53 |
55 // The scroll buttons. | 54 // The scroll buttons. |
56 View* scroll_up_button_; | 55 View* scroll_up_button_; |
57 View* scroll_down_button_; | 56 View* scroll_down_button_; |
58 | 57 |
59 // The scroll view. | 58 // The scroll view. |
60 MenuScrollView* scroll_view_; | 59 MenuScrollView* scroll_view_; |
61 | 60 |
62 // The content view. | 61 // The content view. |
63 SubmenuView* content_view_; | 62 SubmenuView* content_view_; |
64 | 63 |
65 // If set the currently set border is a bubble border. | 64 // If set the currently set border is a bubble border. |
66 BubbleBorder::Arrow arrow_; | 65 BubbleBorder::Arrow arrow_; |
67 | 66 |
68 // Weak reference to the currently set border. | 67 // Weak reference to the currently set border. |
69 BubbleBorder* bubble_border_; | 68 BubbleBorder* bubble_border_; |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(MenuScrollViewContainer); | 70 DISALLOW_COPY_AND_ASSIGN(MenuScrollViewContainer); |
72 }; | 71 }; |
73 | 72 |
74 } // namespace views | 73 } // namespace views |
75 | 74 |
76 #endif // UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ | 75 #endif // UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ |
OLD | NEW |