| 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_NATIVE_MENU_WIN_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/views/views_export.h" | 14 #include "ui/views/views_export.h" |
| 14 | 15 |
| 15 namespace ui { | 16 namespace ui { |
| 16 class MenuModel; | 17 class MenuModel; |
| 17 } | 18 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 HMENU menu_; | 82 HMENU menu_; |
| 82 | 83 |
| 83 // True if the contents of menu items in this menu are drawn by the menu host | 84 // True if the contents of menu items in this menu are drawn by the menu host |
| 84 // window, rather than Windows. | 85 // window, rather than Windows. |
| 85 bool owner_draw_; | 86 bool owner_draw_; |
| 86 | 87 |
| 87 // An object that collects all of the data associated with an individual menu | 88 // An object that collects all of the data associated with an individual menu |
| 88 // item. | 89 // item. |
| 89 struct ItemData; | 90 struct ItemData; |
| 90 std::vector<ItemData*> items_; | 91 std::vector<std::unique_ptr<ItemData>> items_; |
| 91 | 92 |
| 92 // The HWND this menu is the system menu for, or NULL if the menu is not a | 93 // The HWND this menu is the system menu for, or NULL if the menu is not a |
| 93 // system menu. | 94 // system menu. |
| 94 HWND system_menu_for_; | 95 HWND system_menu_for_; |
| 95 | 96 |
| 96 // The index of the first item in the model in the menu. | 97 // The index of the first item in the model in the menu. |
| 97 int first_item_index_; | 98 int first_item_index_; |
| 98 | 99 |
| 99 // If we're a submenu, this is our parent. | 100 // If we're a submenu, this is our parent. |
| 100 NativeMenuWin* parent_; | 101 NativeMenuWin* parent_; |
| 101 | 102 |
| 102 // If non-null the destructor sets this to true. This is set to non-null while | 103 // If non-null the destructor sets this to true. This is set to non-null while |
| 103 // the menu is showing. It is used to detect if the menu was deleted while | 104 // the menu is showing. It is used to detect if the menu was deleted while |
| 104 // running. | 105 // running. |
| 105 bool* destroyed_flag_; | 106 bool* destroyed_flag_; |
| 106 | 107 |
| 107 DISALLOW_COPY_AND_ASSIGN(NativeMenuWin); | 108 DISALLOW_COPY_AND_ASSIGN(NativeMenuWin); |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 } // namespace views | 111 } // namespace views |
| 111 | 112 |
| 112 #endif // UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ | 113 #endif // UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ |
| OLD | NEW |