Update cef_handler_menucapabilitybits_t arguments from WebContextMenuData::EditFlags (issue #114).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@99 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2010-08-31 15:33:48 +00:00
parent d51d871a52
commit e70fd64a52
2 changed files with 14 additions and 11 deletions

View File

@ -164,6 +164,7 @@ enum cef_handler_menutypebits_t
// following values.
enum cef_handler_menucapabilitybits_t
{
// Values from WebContextMenuData::EditFlags in WebContextMenuData.h
MENU_CAN_DO_NONE = 0x0,
MENU_CAN_UNDO = 0x1,
MENU_CAN_REDO = 0x2,
@ -172,8 +173,10 @@ enum cef_handler_menucapabilitybits_t
MENU_CAN_PASTE = 0x10,
MENU_CAN_DELETE = 0x20,
MENU_CAN_SELECT_ALL = 0x40,
MENU_CAN_GO_FORWARD = 0x80,
MENU_CAN_GO_BACK = 0x100,
MENU_CAN_TRANSLATE = 0x80,
// Values unique to CEF
MENU_CAN_GO_FORWARD = 0x10000000,
MENU_CAN_GO_BACK = 0x20000000,
};
// Supported menu ID values.

View File

@ -318,31 +318,31 @@ void BrowserWebViewDelegate::showContextMenu(
if (type_flags & MENUTYPE_EDITABLE) {
menu = CreatePopupMenu();
AddMenuItem(browser_, menu, -1, MENU_ID_UNDO, L"Undo",
!!(edit_flags & WebContextMenuData::CanUndo), label_list);
!!(edit_flags & MENU_CAN_UNDO), label_list);
AddMenuItem(browser_, menu, -1, MENU_ID_REDO, L"Redo",
!!(edit_flags & WebContextMenuData::CanRedo), label_list);
!!(edit_flags & MENU_CAN_REDO), label_list);
AddMenuSeparator(menu, -1);
AddMenuItem(browser_, menu, -1, MENU_ID_CUT, L"Cut",
!!(edit_flags & WebContextMenuData::CanCut), label_list);
!!(edit_flags & MENU_CAN_CUT), label_list);
AddMenuItem(browser_, menu, -1, MENU_ID_COPY, L"Copy",
!!(edit_flags & WebContextMenuData::CanCopy), label_list);
!!(edit_flags & MENU_CAN_COPY), label_list);
AddMenuItem(browser_, menu, -1, MENU_ID_PASTE, L"Paste",
!!(edit_flags & WebContextMenuData::CanPaste), label_list);
!!(edit_flags & MENU_CAN_PASTE), label_list);
AddMenuItem(browser_, menu, -1, MENU_ID_DELETE, L"Delete",
!!(edit_flags & WebContextMenuData::CanDelete), label_list);
!!(edit_flags & MENU_CAN_DELETE), label_list);
AddMenuSeparator(menu, -1);
AddMenuItem(browser_, menu, -1, MENU_ID_SELECTALL, L"Select All",
!!(edit_flags & MENU_CAN_SELECT_ALL), label_list);
} else if(type_flags & MENUTYPE_SELECTION) {
menu = CreatePopupMenu();
AddMenuItem(browser_, menu, -1, MENU_ID_COPY, L"Copy",
!!(edit_flags & WebContextMenuData::CanCopy), label_list);
!!(edit_flags & MENU_CAN_COPY), label_list);
} else if(type_flags & (MENUTYPE_PAGE | MENUTYPE_FRAME)) {
menu = CreatePopupMenu();
AddMenuItem(browser_, menu, -1, MENU_ID_NAV_BACK, L"Back",
browser_->UIT_CanGoBack(), label_list);
!!(edit_flags & MENU_CAN_GO_BACK), label_list);
AddMenuItem(browser_, menu, -1, MENU_ID_NAV_FORWARD, L"Forward",
browser_->UIT_CanGoForward(), label_list);
!!(edit_flags & MENU_CAN_GO_FORWARD), label_list);
AddMenuSeparator(menu, -1);
AddMenuItem(browser_, menu, -1, MENU_ID_PRINT, L"Print",
true, label_list);