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

@@ -462,6 +462,12 @@ void ClientHandler::OnDraggableRegionsChanged(
NotifyDraggableRegions(regions);
}
void ClientHandler::OnTakeFocus(CefRefPtr<CefBrowser> browser, bool next) {
CEF_REQUIRE_UI_THREAD();
NotifyTakeFocus(next);
}
bool ClientHandler::OnRequestGeolocationPermission(
CefRefPtr<CefBrowser> browser,
const CefString& requesting_url,
@@ -990,6 +996,18 @@ void ClientHandler::NotifyDraggableRegions(
delegate_->OnSetDraggableRegions(regions);
}
void ClientHandler::NotifyTakeFocus(bool next) {
if (!CURRENTLY_ON_MAIN_THREAD()) {
// Execute this method on the main thread.
MAIN_POST_CLOSURE(
base::Bind(&ClientHandler::NotifyTakeFocus, this, next));
return;
}
if (delegate_)
delegate_->OnTakeFocus(next);
}
void ClientHandler::BuildTestMenu(CefRefPtr<CefMenuModel> model) {
if (model->GetCount() > 0)
model->AddSeparator();