views: Add support for accelerators (issue #2102)

This commit is contained in:
Marshall Greenblatt
2017-02-16 18:19:43 -05:00
parent e4867b5afb
commit bd1b80198f
35 changed files with 948 additions and 74 deletions

View File

@@ -30,6 +30,7 @@ class ClientHandler : public CefClient,
public CefDisplayHandler,
public CefDownloadHandler,
public CefDragHandler,
public CefFocusHandler,
public CefGeolocationHandler,
public CefKeyboardHandler,
public CefLifeSpanHandler,
@@ -70,6 +71,9 @@ class ClientHandler : public CefClient,
virtual void OnSetDraggableRegions(
const std::vector<CefDraggableRegion>& regions) = 0;
// Set focus to the next/previous control.
virtual void OnTakeFocus(bool next) {}
protected:
virtual ~Delegate() {}
};
@@ -99,6 +103,9 @@ class ClientHandler : public CefClient,
CefRefPtr<CefDragHandler> GetDragHandler() OVERRIDE {
return this;
}
CefRefPtr<CefFocusHandler> GetFocusHandler() OVERRIDE {
return this;
}
CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() OVERRIDE {
return this;
}
@@ -168,11 +175,13 @@ class ClientHandler : public CefClient,
bool OnDragEnter(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDragData> dragData,
CefDragHandler::DragOperationsMask mask) OVERRIDE;
void OnDraggableRegionsChanged(
CefRefPtr<CefBrowser> browser,
const std::vector<CefDraggableRegion>& regions) OVERRIDE;
// CefFocusHandler methods
void OnTakeFocus(CefRefPtr<CefBrowser> browser, bool next) OVERRIDE;
// CefGeolocationHandler methods
bool OnRequestGeolocationPermission(
CefRefPtr<CefBrowser> browser,
@@ -323,6 +332,7 @@ class ClientHandler : public CefClient,
bool canGoForward);
void NotifyDraggableRegions(
const std::vector<CefDraggableRegion>& regions);
void NotifyTakeFocus(bool next);
// Test context menu creation.
void BuildTestMenu(CefRefPtr<CefMenuModel> model);