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 | |
330 protected: | 327 protected: |
331 // Creates a MenuItemView. This is used by the various AddXXX methods. | 328 // Creates a MenuItemView. This is used by the various AddXXX methods. |
332 MenuItemView(MenuItemView* parent, int command, Type type); | 329 MenuItemView(MenuItemView* parent, int command, Type type); |
333 | 330 |
334 // MenuRunner owns MenuItemView and should be the only one deleting it. | 331 // MenuRunner owns MenuItemView and should be the only one deleting it. |
335 ~MenuItemView() override; | 332 ~MenuItemView() override; |
336 | 333 |
337 void ChildPreferredSizeChanged(View* child) override; | 334 void ChildPreferredSizeChanged(View* child) override; |
338 | 335 |
339 const char* GetClassName() const override; | 336 const char* GetClassName() const override; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 // If set to false, the right margin will be removed for menu lines | 518 // If set to false, the right margin will be removed for menu lines |
522 // containing other elements. | 519 // containing other elements. |
523 bool use_right_margin_; | 520 bool use_right_margin_; |
524 | 521 |
525 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 522 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
526 }; | 523 }; |
527 | 524 |
528 } // namespace views | 525 } // namespace views |
529 | 526 |
530 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 527 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
OLD | NEW |