OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SUBMENU_VIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // Returns the number of child views that are MenuItemViews. | 48 // Returns the number of child views that are MenuItemViews. |
49 // MenuItemViews are identified by ID. | 49 // MenuItemViews are identified by ID. |
50 int GetMenuItemCount(); | 50 int GetMenuItemCount(); |
51 | 51 |
52 // Returns the MenuItemView at the specified index. | 52 // Returns the MenuItemView at the specified index. |
53 MenuItemView* GetMenuItemAt(int index); | 53 MenuItemView* GetMenuItemAt(int index); |
54 | 54 |
55 // Positions and sizes the child views. This tiles the views vertically, | 55 // Positions and sizes the child views. This tiles the views vertically, |
56 // giving each child the available width. | 56 // giving each child the available width. |
57 virtual void Layout() OVERRIDE; | 57 virtual void Layout() OVERRIDE; |
58 virtual gfx::Size GetPreferredSize() OVERRIDE; | 58 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
59 | 59 |
60 // Override from View. | 60 // Override from View. |
61 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 61 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
62 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; | 62 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; |
63 | 63 |
64 // Painting. | 64 // Painting. |
65 virtual void PaintChildren(gfx::Canvas* canvas, | 65 virtual void PaintChildren(gfx::Canvas* canvas, |
66 const views::CullSet& cull_view) OVERRIDE; | 66 const views::CullSet& cull_view) OVERRIDE; |
67 | 67 |
68 // Drag and drop methods. These are forwarded to the MenuController. | 68 // Drag and drop methods. These are forwarded to the MenuController. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // the drop is over. | 194 // the drop is over. |
195 MenuItemView* drop_item_; | 195 MenuItemView* drop_item_; |
196 | 196 |
197 // Position of the drop. | 197 // Position of the drop. |
198 MenuDelegate::DropPosition drop_position_; | 198 MenuDelegate::DropPosition drop_position_; |
199 | 199 |
200 // Ancestor of the SubmenuView, lazily created. | 200 // Ancestor of the SubmenuView, lazily created. |
201 MenuScrollViewContainer* scroll_view_container_; | 201 MenuScrollViewContainer* scroll_view_container_; |
202 | 202 |
203 // See description above getter. | 203 // See description above getter. |
204 int max_minor_text_width_; | 204 mutable int max_minor_text_width_; |
205 | 205 |
206 // Minimum width returned in GetPreferredSize(). | 206 // Minimum width returned in GetPreferredSize(). |
207 int minimum_preferred_width_; | 207 int minimum_preferred_width_; |
208 | 208 |
209 // Reposition open menu when contained views change size. | 209 // Reposition open menu when contained views change size. |
210 bool resize_open_menu_; | 210 bool resize_open_menu_; |
211 | 211 |
212 // The submenu's scroll animator | 212 // The submenu's scroll animator |
213 scoped_ptr<ScrollAnimator> scroll_animator_; | 213 scoped_ptr<ScrollAnimator> scroll_animator_; |
214 | 214 |
215 // Difference between current position and cumulative deltas passed to | 215 // Difference between current position and cumulative deltas passed to |
216 // OnScroll. | 216 // OnScroll. |
217 // TODO(tdresser): This should be removed when raw pixel scrolling for views | 217 // TODO(tdresser): This should be removed when raw pixel scrolling for views |
218 // is enabled. See crbug.com/329354. | 218 // is enabled. See crbug.com/329354. |
219 float roundoff_error_; | 219 float roundoff_error_; |
220 | 220 |
221 PrefixSelector prefix_selector_; | 221 PrefixSelector prefix_selector_; |
222 | 222 |
223 DISALLOW_COPY_AND_ASSIGN(SubmenuView); | 223 DISALLOW_COPY_AND_ASSIGN(SubmenuView); |
224 }; | 224 }; |
225 | 225 |
226 } // namespace views | 226 } // namespace views |
227 | 227 |
228 #endif // UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ | 228 #endif // UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ |
OLD | NEW |