Chromium Code Reviews| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 // Creates a MenuItemView. This is used by the various AddXXX methods. | 314 // Creates a MenuItemView. This is used by the various AddXXX methods. |
| 315 MenuItemView(MenuItemView* parent, int command, Type type); | 315 MenuItemView(MenuItemView* parent, int command, Type type); |
| 316 | 316 |
| 317 // MenuRunner owns MenuItemView and should be the only one deleting it. | 317 // MenuRunner owns MenuItemView and should be the only one deleting it. |
| 318 virtual ~MenuItemView(); | 318 virtual ~MenuItemView(); |
| 319 | 319 |
| 320 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; | 320 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; |
| 321 | 321 |
| 322 virtual std::string GetClassName() const OVERRIDE; | 322 virtual std::string GetClassName() const OVERRIDE; |
| 323 | 323 |
| 324 virtual MenuItemView* AllocateMenuItemView(MenuItemView* parent, int item_id, | |
|
Aaron Boodman
2012/06/12 05:53:44
You're right, this looks like a funny change.
Ins
yefimt
2012/06/13 01:24:21
Done.
| |
| 325 Type type); | |
| 326 | |
| 327 // Returns the various margins. | |
| 328 int GetTopMargin(); | |
|
Aaron Boodman
2012/06/12 05:53:44
This isn't called anywhere. Does it need to be pub
yefimt
2012/06/13 01:24:21
Done.
| |
| 329 int GetBottomMargin(); | |
| 330 | |
| 324 private: | 331 private: |
| 325 friend class internal::MenuRunnerImpl; // For access to ~MenuItemView. | 332 friend class internal::MenuRunnerImpl; // For access to ~MenuItemView. |
| 326 | 333 |
| 327 // Calculates all sizes that we can from the OS. | 334 // Calculates all sizes that we can from the OS. |
| 328 // | 335 // |
| 329 // This is invoked prior to Running a menu. | 336 // This is invoked prior to Running a menu. |
| 330 static void UpdateMenuPartSizes(bool has_icons); | 337 static void UpdateMenuPartSizes(bool has_icons); |
| 331 | 338 |
| 332 // Called by the two constructors to initialize this menu item. | 339 // Called by the two constructors to initialize this menu item. |
| 333 void Init(MenuItemView* parent, | 340 void Init(MenuItemView* parent, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 375 // Paints the accelerator. | 382 // Paints the accelerator. |
| 376 void PaintAccelerator(gfx::Canvas* canvas); | 383 void PaintAccelerator(gfx::Canvas* canvas); |
| 377 | 384 |
| 378 // Destroys the window used to display this menu and recursively destroys | 385 // Destroys the window used to display this menu and recursively destroys |
| 379 // the windows used to display all descendants. | 386 // the windows used to display all descendants. |
| 380 void DestroyAllMenuHosts(); | 387 void DestroyAllMenuHosts(); |
| 381 | 388 |
| 382 // Returns the accelerator text. | 389 // Returns the accelerator text. |
| 383 string16 GetAcceleratorText(); | 390 string16 GetAcceleratorText(); |
| 384 | 391 |
| 385 // Returns the various margins. | |
| 386 int GetTopMargin(); | |
| 387 int GetBottomMargin(); | |
| 388 | |
| 389 // Returns the preferred size (and padding) of any children. | 392 // Returns the preferred size (and padding) of any children. |
| 390 gfx::Size GetChildPreferredSize(); | 393 gfx::Size GetChildPreferredSize(); |
| 391 | 394 |
| 392 // Calculates the preferred size. | 395 // Calculates the preferred size. |
| 393 gfx::Size CalculatePreferredSize(); | 396 gfx::Size CalculatePreferredSize(); |
| 394 | 397 |
| 395 // Used by MenuController to cache the menu position in use by the | 398 // Used by MenuController to cache the menu position in use by the |
| 396 // active menu. | 399 // active menu. |
| 397 MenuPosition actual_menu_position() const { return actual_menu_position_; } | 400 MenuPosition actual_menu_position() const { return actual_menu_position_; } |
| 398 void set_actual_menu_position(MenuPosition actual_menu_position) { | 401 void set_actual_menu_position(MenuPosition actual_menu_position) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 479 // If set to false, the right margin will be removed for menu lines | 482 // If set to false, the right margin will be removed for menu lines |
| 480 // containing other elements. | 483 // containing other elements. |
| 481 bool use_right_margin_; | 484 bool use_right_margin_; |
| 482 | 485 |
| 483 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 486 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
| 484 }; | 487 }; |
| 485 | 488 |
| 486 } // namespace views | 489 } // namespace views |
| 487 | 490 |
| 488 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 491 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| OLD | NEW |