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

@ -37,6 +37,23 @@ void CEF_CALLBACK button_delegate_on_button_pressed(
CefButtonCToCpp::Wrap(button));
}
void CEF_CALLBACK button_delegate_on_button_state_changed(
struct _cef_button_delegate_t* self, cef_button_t* button) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: button; type: refptr_diff
DCHECK(button);
if (!button)
return;
// Execute
CefButtonDelegateCppToC::Get(self)->OnButtonStateChanged(
CefButtonCToCpp::Wrap(button));
}
cef_size_t CEF_CALLBACK button_delegate_get_preferred_size(
struct _cef_view_delegate_t* self, cef_view_t* view) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -215,6 +232,8 @@ void CEF_CALLBACK button_delegate_on_blur(struct _cef_view_delegate_t* self,
CefButtonDelegateCppToC::CefButtonDelegateCppToC() {
GetStruct()->on_button_pressed = button_delegate_on_button_pressed;
GetStruct()->on_button_state_changed =
button_delegate_on_button_state_changed;
GetStruct()->base.get_preferred_size = button_delegate_get_preferred_size;
GetStruct()->base.get_minimum_size = button_delegate_get_minimum_size;
GetStruct()->base.get_maximum_size = button_delegate_get_maximum_size;