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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 317 |
318 // Set top and bottom margins in pixels. If no margin is set or a | 318 // Set top and bottom margins in pixels. If no margin is set or a |
319 // negative margin is specified then MenuConfig values are used. | 319 // negative margin is specified then MenuConfig values are used. |
320 void SetMargins(int top_margin, int bottom_margin); | 320 void SetMargins(int top_margin, int bottom_margin); |
321 | 321 |
322 // Suppress the right margin if this is set to false. | 322 // Suppress the right margin if this is set to false. |
323 void set_use_right_margin(bool use_right_margin) { | 323 void set_use_right_margin(bool use_right_margin) { |
324 use_right_margin_ = use_right_margin; | 324 use_right_margin_ = use_right_margin; |
325 } | 325 } |
326 | 326 |
| 327 // Returns a reference to MenuConfig to be used with this menu. |
| 328 const MenuConfig& GetMenuConfig() const; |
| 329 |
327 protected: | 330 protected: |
328 // Creates a MenuItemView. This is used by the various AddXXX methods. | 331 // Creates a MenuItemView. This is used by the various AddXXX methods. |
329 MenuItemView(MenuItemView* parent, int command, Type type); | 332 MenuItemView(MenuItemView* parent, int command, Type type); |
330 | 333 |
331 // MenuRunner owns MenuItemView and should be the only one deleting it. | 334 // MenuRunner owns MenuItemView and should be the only one deleting it. |
332 ~MenuItemView() override; | 335 ~MenuItemView() override; |
333 | 336 |
334 void ChildPreferredSizeChanged(View* child) override; | 337 void ChildPreferredSizeChanged(View* child) override; |
335 | 338 |
336 const char* GetClassName() const override; | 339 const char* GetClassName() const override; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 // 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 |
519 // containing other elements. | 522 // containing other elements. |
520 bool use_right_margin_; | 523 bool use_right_margin_; |
521 | 524 |
522 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 525 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
523 }; | 526 }; |
524 | 527 |
525 } // namespace views | 528 } // namespace views |
526 | 529 |
527 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 530 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
OLD | NEW |