| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| 6 #define VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| 7 | 7 |
| 8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 9 #include "views/view.h" | 9 #include "views/view.h" |
| 10 | 10 |
| 11 namespace views { | 11 namespace views { |
| 12 | 12 |
| 13 class MenuButton; |
| 13 class MenuController; | 14 class MenuController; |
| 14 class MenuDelegate; | 15 class MenuDelegate; |
| 15 class SubmenuView; | 16 class SubmenuView; |
| 16 | 17 |
| 17 // MenuItemView -------------------------------------------------------------- | 18 // MenuItemView -------------------------------------------------------------- |
| 18 | 19 |
| 19 // MenuItemView represents a single menu item with a label and optional icon. | 20 // MenuItemView represents a single menu item with a label and optional icon. |
| 20 // Each MenuItemView may also contain a submenu, which in turn may contain | 21 // Each MenuItemView may also contain a submenu, which in turn may contain |
| 21 // any number of child MenuItemViews. | 22 // any number of child MenuItemViews. |
| 22 // | 23 // |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 static int pref_menu_height() { return pref_menu_height_; } | 76 static int pref_menu_height() { return pref_menu_height_; } |
| 76 | 77 |
| 77 // X-coordinate of where the label starts. | 78 // X-coordinate of where the label starts. |
| 78 static int label_start() { return label_start_; } | 79 static int label_start() { return label_start_; } |
| 79 | 80 |
| 80 // Run methods. See description above class for details. Both Run methods take | 81 // Run methods. See description above class for details. Both Run methods take |
| 81 // a rectangle, which is used to position the menu. |has_mnemonics| indicates | 82 // a rectangle, which is used to position the menu. |has_mnemonics| indicates |
| 82 // whether the items have mnemonics. Mnemonics are identified by way of the | 83 // whether the items have mnemonics. Mnemonics are identified by way of the |
| 83 // character following the '&'. | 84 // character following the '&'. |
| 84 void RunMenuAt(gfx::NativeWindow parent, | 85 void RunMenuAt(gfx::NativeWindow parent, |
| 86 MenuButton* button, |
| 85 const gfx::Rect& bounds, | 87 const gfx::Rect& bounds, |
| 86 AnchorPosition anchor, | 88 AnchorPosition anchor, |
| 87 bool has_mnemonics); | 89 bool has_mnemonics); |
| 88 void RunMenuForDropAt(gfx::NativeWindow parent, | 90 void RunMenuForDropAt(gfx::NativeWindow parent, |
| 89 const gfx::Rect& bounds, | 91 const gfx::Rect& bounds, |
| 90 AnchorPosition anchor); | 92 AnchorPosition anchor); |
| 91 | 93 |
| 92 // Hides and cancels the menu. This does nothing if the menu is not open. | 94 // Hides and cancels the menu. This does nothing if the menu is not open. |
| 93 void Cancel(); | 95 void Cancel(); |
| 94 | 96 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 325 |
| 324 // Preferred height of menu items. Reset every time a menu is run. | 326 // Preferred height of menu items. Reset every time a menu is run. |
| 325 static int pref_menu_height_; | 327 static int pref_menu_height_; |
| 326 | 328 |
| 327 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 329 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
| 328 }; | 330 }; |
| 329 | 331 |
| 330 } // namespace views | 332 } // namespace views |
| 331 | 333 |
| 332 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 334 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| OLD | NEW |