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

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

Issue 12041085: Fix menu corners: the menu background was being painted as a rect when in fact, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 11 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
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 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 OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; 26 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE;
27 virtual void Layout() OVERRIDE; 27 virtual void Layout() OVERRIDE;
28 virtual gfx::Size GetPreferredSize() OVERRIDE; 28 virtual gfx::Size GetPreferredSize() OVERRIDE;
29 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 29 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
30 virtual gfx::Insets GetInsets() const OVERRIDE;
30 31
31 protected: 32 protected:
32 // View override. 33 // View override.
33 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; 34 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
34 35
35 private: 36 private:
36 class MenuScrollView; 37 class MenuScrollView;
37 38
38 // The scroll buttons. 39 // The scroll buttons.
39 View* scroll_up_button_; 40 View* scroll_up_button_;
40 View* scroll_down_button_; 41 View* scroll_down_button_;
41 42
42 // The scroll view. 43 // The scroll view.
43 MenuScrollView* scroll_view_; 44 MenuScrollView* scroll_view_;
44 45
45 // The content view. 46 // The content view.
46 SubmenuView* content_view_; 47 SubmenuView* content_view_;
47 48
48 DISALLOW_COPY_AND_ASSIGN(MenuScrollViewContainer); 49 DISALLOW_COPY_AND_ASSIGN(MenuScrollViewContainer);
49 }; 50 };
50 51
51 } // namespace views 52 } // namespace views
52 53
53 #endif // UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ 54 #endif // UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698