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_MENU_ITEM_VIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... | |
27 namespace gfx { | 27 namespace gfx { |
28 class FontList; | 28 class FontList; |
29 } | 29 } |
30 | 30 |
31 namespace views { | 31 namespace views { |
32 | 32 |
33 namespace internal { | 33 namespace internal { |
34 class MenuRunnerImpl; | 34 class MenuRunnerImpl; |
35 } | 35 } |
36 | 36 |
37 namespace { | |
38 class TestMenuItemViewShown; | |
sadrul
2015/07/19 01:11:49
namespace test?
varkha
2015/07/21 20:00:44
Done.
| |
39 } | |
40 | |
37 class MenuController; | 41 class MenuController; |
38 class MenuDelegate; | 42 class MenuDelegate; |
39 class SubmenuView; | 43 class SubmenuView; |
40 | 44 |
41 // MenuItemView -------------------------------------------------------------- | 45 // MenuItemView -------------------------------------------------------------- |
42 | 46 |
43 // MenuItemView represents a single menu item with a label and optional icon. | 47 // MenuItemView represents a single menu item with a label and optional icon. |
44 // Each MenuItemView may also contain a submenu, which in turn may contain | 48 // Each MenuItemView may also contain a submenu, which in turn may contain |
45 // any number of child MenuItemViews. | 49 // any number of child MenuItemViews. |
46 // | 50 // |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 | 340 |
337 // Returns the preferred size (and padding) of any children. | 341 // Returns the preferred size (and padding) of any children. |
338 virtual gfx::Size GetChildPreferredSize() const; | 342 virtual gfx::Size GetChildPreferredSize() const; |
339 | 343 |
340 // Returns the various margins. | 344 // Returns the various margins. |
341 int GetTopMargin() const; | 345 int GetTopMargin() const; |
342 int GetBottomMargin() const; | 346 int GetBottomMargin() const; |
343 | 347 |
344 private: | 348 private: |
345 friend class internal::MenuRunnerImpl; // For access to ~MenuItemView. | 349 friend class internal::MenuRunnerImpl; // For access to ~MenuItemView. |
350 friend class TestMenuItemViewShown; // for access to |submenu_|; | |
346 | 351 |
347 enum PaintButtonMode { PB_NORMAL, PB_FOR_DRAG }; | 352 enum PaintButtonMode { PB_NORMAL, PB_FOR_DRAG }; |
348 | 353 |
349 // Calculates all sizes that we can from the OS. | 354 // Calculates all sizes that we can from the OS. |
350 // | 355 // |
351 // This is invoked prior to Running a menu. | 356 // This is invoked prior to Running a menu. |
352 void UpdateMenuPartSizes(); | 357 void UpdateMenuPartSizes(); |
353 | 358 |
354 // Called by the two constructors to initialize this menu item. | 359 // Called by the two constructors to initialize this menu item. |
355 void Init(MenuItemView* parent, | 360 void Init(MenuItemView* parent, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 // If set to false, the right margin will be removed for menu lines | 521 // If set to false, the right margin will be removed for menu lines |
517 // containing other elements. | 522 // containing other elements. |
518 bool use_right_margin_; | 523 bool use_right_margin_; |
519 | 524 |
520 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 525 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
521 }; | 526 }; |
522 | 527 |
523 } // namespace views | 528 } // namespace views |
524 | 529 |
525 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 530 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
OLD | NEW |