views: Add groups and focus/blur callbacks (issue #2102)

- cefclient: Only make menus focusable when ALT is pressed.
- cefclient: Display sample top menu when passed the `--show-top-menu`
  command-line flag.
This commit is contained in:
Marshall Greenblatt
2017-02-17 21:08:51 -05:00
parent bd1b80198f
commit 6ed4fe96b8
58 changed files with 1284 additions and 39 deletions

View File

@@ -377,6 +377,8 @@ CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter,
CefRefPtr<CefWindow> GetWindow() override;
int GetID() override;
void SetID(int id) override;
int GetGroupID() override;
void SetGroupID(int group_id) override;
CefRefPtr<CefView> GetParentView() override;
CefRefPtr<CefView> GetViewForID(int id) override;
void SetBounds(const CefRect& bounds) override;
@@ -507,6 +509,19 @@ CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetID(int id) {
root_view()->set_id(id);
}
CEF_VIEW_IMPL_T int CEF_VIEW_IMPL_D::GetGroupID() {
CEF_REQUIRE_VALID_RETURN(0);
return root_view()->GetGroup();
}
CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetGroupID(int group_id) {
CEF_REQUIRE_VALID_RETURN_VOID();
if (root_view()->GetGroup() != -1)
return;
root_view()->SetGroup(group_id);
}
CEF_VIEW_IMPL_T CefRefPtr<CefView> CEF_VIEW_IMPL_D::GetParentView() {
CEF_REQUIRE_VALID_RETURN(nullptr);
views::View* view = root_view()->parent();