views: Support top menu switching with mouse and arrow keys (issue #2102)

- cefclient: Add example ViewsMenuBar implementation and show top menu
  by default (specify `--hide-top-menu` to hide it).
This commit is contained in:
Marshall Greenblatt
2017-02-22 13:05:27 -05:00
parent fbc8b983d5
commit 6eaf11f07a
42 changed files with 1055 additions and 152 deletions

View File

@@ -55,6 +55,25 @@ void CefMenuButtonDelegateCToCpp::OnButtonPressed(CefRefPtr<CefButton> button) {
CefButtonCppToC::Wrap(button));
}
void CefMenuButtonDelegateCToCpp::OnButtonStateChanged(
CefRefPtr<CefButton> button) {
cef_button_delegate_t* _struct = reinterpret_cast<cef_button_delegate_t*>(
GetStruct());
if (CEF_MEMBER_MISSING(_struct, on_button_state_changed))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: button; type: refptr_diff
DCHECK(button.get());
if (!button.get())
return;
// Execute
_struct->on_button_state_changed(_struct,
CefButtonCppToC::Wrap(button));
}
CefSize CefMenuButtonDelegateCToCpp::GetPreferredSize(CefRefPtr<CefView> view) {
cef_view_delegate_t* _struct = reinterpret_cast<cef_view_delegate_t*>(
GetStruct());