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

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

Issue 1812303002: Added Layer based clipping to MenuScrollViewContainer::MenuScrollView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODO with reference to bug. Created 4 years, 8 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
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_scroll_view_container.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/views/bubble/bubble_border.h" 9 #include "ui/views/bubble/bubble_border.h"
10 #include "ui/views/controls/menu/menu_types.h" 10 #include "ui/views/controls/menu/menu_types.h"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 12
13 namespace views { 13 namespace views {
14 14
15 class SubmenuView; 15 class SubmenuView;
16 16
17 // MenuScrollViewContainer contains the SubmenuView (through a MenuScrollView) 17 // MenuScrollViewContainer contains the SubmenuView (through a MenuScrollView)
18 // and two scroll buttons. The scroll buttons are only visible and enabled if 18 // and two scroll buttons. The scroll buttons are only visible and enabled if
19 // the preferred height of the SubmenuView is bigger than our bounds. 19 // the preferred height of the SubmenuView is bigger than our bounds.
20 class MenuScrollViewContainer : public View { 20 class MenuScrollViewContainer : public View {
21 public: 21 public:
22 static const char kViewClassName[];
23
22 explicit MenuScrollViewContainer(SubmenuView* content_view); 24 explicit MenuScrollViewContainer(SubmenuView* content_view);
23 25
24 // Returns the buttons for scrolling up/down. 26 // Returns the buttons for scrolling up/down.
25 View* scroll_down_button() const { return scroll_down_button_; } 27 View* scroll_down_button() const { return scroll_down_button_; }
26 View* scroll_up_button() const { return scroll_up_button_; } 28 View* scroll_up_button() const { return scroll_up_button_; }
27 29
28 // External function to check if the bubble border is usd. 30 // External function to check if the bubble border is usd.
29 bool HasBubbleBorder(); 31 bool HasBubbleBorder();
30 32
31 // Offsets the Arrow from the default location. 33 // Offsets the Arrow from the default location.
32 void SetBubbleArrowOffset(int offset); 34 void SetBubbleArrowOffset(int offset);
33 35
34 // View overrides. 36 // View overrides.
37 const char* GetClassName() const override;
35 gfx::Size GetPreferredSize() const override; 38 gfx::Size GetPreferredSize() const override;
36 void Layout() override; 39 void Layout() override;
37 void OnPaintBackground(gfx::Canvas* canvas) override; 40 void OnPaintBackground(gfx::Canvas* canvas) override;
38 void GetAccessibleState(ui::AXViewState* state) override; 41 void GetAccessibleState(ui::AXViewState* state) override;
39 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; 42 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
40 43
41 protected: 44 protected:
42 // View override. 45 // View override.
43 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; 46 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
44 47
(...skipping 23 matching lines...) Expand all
68 71
69 // Weak reference to the currently set border. 72 // Weak reference to the currently set border.
70 BubbleBorder* bubble_border_; 73 BubbleBorder* bubble_border_;
71 74
72 DISALLOW_COPY_AND_ASSIGN(MenuScrollViewContainer); 75 DISALLOW_COPY_AND_ASSIGN(MenuScrollViewContainer);
73 }; 76 };
74 77
75 } // namespace views 78 } // namespace views
76 79
77 #endif // UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_ 80 #endif // UI_VIEWS_CONTROLS_MENU_MENU_SCROLL_VIEW_CONTAINER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_scroll_view_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698