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

Side by Side Diff: views/controls/menu/menu_scroll_view_container.h

Issue 2741004: Makes it so child views of menuitemview can be traversed with the (Closed)
Patch Set: Tweaks Created 10 years, 6 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ 5 #ifndef VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_
6 #define VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ 6 #define VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_
7 7
8 #include "views/view.h" 8 #include "views/view.h"
9 9
10 namespace views { 10 namespace views {
11 11
12 class SubmenuView; 12 class SubmenuView;
13 13
14 // MenuScrollViewContainer contains the SubmenuView (through a MenuScrollView) 14 // MenuScrollViewContainer contains the SubmenuView (through a MenuScrollView)
15 // and two scroll buttons. The scroll buttons are only visible and enabled if 15 // and two scroll buttons. The scroll buttons are only visible and enabled if
16 // the preferred height of the SubmenuView is bigger than our bounds. 16 // the preferred height of the SubmenuView is bigger than our bounds.
17 class MenuScrollViewContainer : public View { 17 class MenuScrollViewContainer : public View {
18 public: 18 public:
19 explicit MenuScrollViewContainer(SubmenuView* content_view); 19 explicit MenuScrollViewContainer(SubmenuView* content_view);
20 20
21 // Returns the buttons for scrolling up/down. 21 // Returns the buttons for scrolling up/down.
22 View* scroll_down_button() const { return scroll_down_button_; } 22 View* scroll_down_button() const { return scroll_down_button_; }
23 View* scroll_up_button() const { return scroll_up_button_; } 23 View* scroll_up_button() const { return scroll_up_button_; }
24 24
25 // View overrides. 25 // View overrides.
26 virtual void Paint(gfx::Canvas* canvas); 26 virtual void PaintBackground(gfx::Canvas* canvas);
27 virtual void Layout(); 27 virtual void Layout();
28 virtual void DidChangeBounds(const gfx::Rect& previous, 28 virtual void DidChangeBounds(const gfx::Rect& previous,
29 const gfx::Rect& current); 29 const gfx::Rect& current);
30 virtual gfx::Size GetPreferredSize(); 30 virtual gfx::Size GetPreferredSize();
31 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); 31 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
32 32
33 private: 33 private:
34 class MenuScrollView; 34 class MenuScrollView;
35 35
36 // The scroll buttons. 36 // The scroll buttons.
37 View* scroll_up_button_; 37 View* scroll_up_button_;
38 View* scroll_down_button_; 38 View* scroll_down_button_;
39 39
40 // The scroll view. 40 // The scroll view.
41 MenuScrollView* scroll_view_; 41 MenuScrollView* scroll_view_;
42 42
43 DISALLOW_COPY_AND_ASSIGN(MenuScrollViewContainer); 43 DISALLOW_COPY_AND_ASSIGN(MenuScrollViewContainer);
44 }; 44 };
45 45
46 } // namespace views 46 } // namespace views
47 47
48 #endif // VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ 48 #endif // VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698