Chromium Code Reviews| 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 WEBMENUITEM_H_ | 5 #ifndef WEBMENUITEM_H_ |
| 6 #define WEBMENUITEM_H_ | 6 #define WEBMENUITEM_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMenuItemInfo.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMenuItemInfo.h" |
| 12 | 12 |
| 13 // Container for information about entries in an HTML select popup menu and | 13 // Container for information about entries in an HTML select popup menu and |
| 14 // custom entries of the context menu. | 14 // custom entries of the context menu. |
| 15 struct WebMenuItem { | 15 struct WebMenuItem { |
| 16 enum Type { | 16 enum Type { |
| 17 OPTION = WebKit::WebMenuItemInfo::Option, | 17 OPTION = WebKit::WebMenuItemInfo::Option, |
| 18 CHECKABLE_OPTION = WebKit::WebMenuItemInfo::CheckableOption, | 18 CHECKABLE_OPTION = WebKit::WebMenuItemInfo::CheckableOption, |
| 19 GROUP = WebKit::WebMenuItemInfo::Group, | 19 GROUP = WebKit::WebMenuItemInfo::Group, |
| 20 SEPARATOR = WebKit::WebMenuItemInfo::Separator, | 20 SEPARATOR = WebKit::WebMenuItemInfo::Separator, |
| 21 SUBMENU // This is currently only used by Pepper, not by WebKit. | 21 SUBMENU // This is currently only used by Pepper, not by WebKit. |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 WebMenuItem(); | |
| 25 WebMenuItem(const WebKit::WebMenuItemInfo& item); | |
| 26 WebMenuItem(const WebMenuItem& item); | |
|
Nico
2011/02/02 01:00:23
This one is new?
Elliot Glaysher
2011/02/02 01:09:26
Correct. std::vector<> calls the copy constructor
| |
| 27 ~WebMenuItem(); | |
| 28 | |
| 24 string16 label; | 29 string16 label; |
| 25 Type type; | 30 Type type; |
| 26 unsigned action; | 31 unsigned action; |
| 27 bool enabled; | 32 bool enabled; |
| 28 bool checked; | 33 bool checked; |
| 29 std::vector<WebMenuItem> submenu; | 34 std::vector<WebMenuItem> submenu; |
| 30 | |
| 31 WebMenuItem() : type(OPTION), action(0), enabled(false), checked(false) { | |
| 32 } | |
| 33 | |
| 34 WebMenuItem(const WebKit::WebMenuItemInfo& item) | |
| 35 : label(item.label), | |
| 36 type(static_cast<Type>(item.type)), | |
| 37 action(item.action), | |
| 38 enabled(item.enabled), | |
| 39 checked(item.checked) { | |
| 40 } | |
| 41 }; | 35 }; |
| 42 | 36 |
| 43 #endif // WEBMENUITEM_H_ | 37 #endif // WEBMENUITEM_H_ |
| OLD | NEW |