| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 // TODO(avi): remove when not needed | 15 // TODO(avi): remove when not needed |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "third_party/skia/include/core/SkBitmap.h" | 17 #include "third_party/skia/include/core/SkBitmap.h" |
| 18 #include "views/view.h" | 18 #include "views/view.h" |
| 19 | 19 |
| 20 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
| 21 #include "ui/gfx/native_theme.h" | 21 #include "ui/gfx/native_theme.h" |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 namespace gfx { |
| 25 class Font; |
| 26 } |
| 27 |
| 24 namespace ui { | 28 namespace ui { |
| 25 class MenuModel; | 29 class MenuModel; |
| 26 } | 30 } |
| 27 | 31 |
| 28 namespace views { | 32 namespace views { |
| 29 | 33 |
| 30 class MenuButton; | 34 class MenuButton; |
| 31 class MenuController; | 35 class MenuController; |
| 32 class MenuDelegate; | 36 class MenuDelegate; |
| 33 class SubmenuView; | 37 class SubmenuView; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // drag and drop run. | 313 // drag and drop run. |
| 310 void DropMenuClosed(bool notify_delegate); | 314 void DropMenuClosed(bool notify_delegate); |
| 311 | 315 |
| 312 // The RunXXX methods call into this to set up the necessary state before | 316 // The RunXXX methods call into this to set up the necessary state before |
| 313 // running. | 317 // running. |
| 314 void PrepareForRun(bool has_mnemonics, bool show_mnemonics); | 318 void PrepareForRun(bool has_mnemonics, bool show_mnemonics); |
| 315 | 319 |
| 316 // Returns the flags passed to DrawStringInt. | 320 // Returns the flags passed to DrawStringInt. |
| 317 int GetDrawStringFlags(); | 321 int GetDrawStringFlags(); |
| 318 | 322 |
| 323 // Returns the font to use for menu text. |
| 324 const gfx::Font* GetFont(); |
| 325 |
| 319 // If this menu item has no children a child is added showing it has no | 326 // If this menu item has no children a child is added showing it has no |
| 320 // children. Otherwise AddEmtpyMenus is recursively invoked on child menu | 327 // children. Otherwise AddEmtpyMenus is recursively invoked on child menu |
| 321 // items that have children. | 328 // items that have children. |
| 322 void AddEmptyMenus(); | 329 void AddEmptyMenus(); |
| 323 | 330 |
| 324 // Undoes the work of AddEmptyMenus. | 331 // Undoes the work of AddEmptyMenus. |
| 325 void RemoveEmptyMenus(); | 332 void RemoveEmptyMenus(); |
| 326 | 333 |
| 327 // Given bounds within our View, this helper routine mirrors the bounds if | 334 // Given bounds within our View, this helper routine mirrors the bounds if |
| 328 // necessary. | 335 // necessary. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 // Previously calculated preferred size to reduce GetStringWidth calls in | 429 // Previously calculated preferred size to reduce GetStringWidth calls in |
| 423 // GetPreferredSize. | 430 // GetPreferredSize. |
| 424 gfx::Size pref_size_; | 431 gfx::Size pref_size_; |
| 425 | 432 |
| 426 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 433 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
| 427 }; | 434 }; |
| 428 | 435 |
| 429 } // namespace views | 436 } // namespace views |
| 430 | 437 |
| 431 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 438 #endif // VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| OLD | NEW |