feat: implement 'app-command' events for browser history navigation keys on Linux (#15441)
* Added mouse forward/back button support on Linux * Added browser history navigation action bindings for Windows, Mac, and Linux keyboard * Removed new `history-action` event and modified `app-command` to execute on such events * Removed attempt at macOS support and added constants * Clarified app-command documentation * Reverted 'app-command' description change * Format code
This commit is contained in:
parent
3f15f51615
commit
d243a45173
11 changed files with 64 additions and 12 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "atom/browser/browser.h"
|
||||
#include "atom/browser/native_window_views.h"
|
||||
#include "atom/common/atom_constants.h"
|
||||
#include "content/public/browser/browser_accessibility_state.h"
|
||||
#include "ui/base/win/accessibility_misc_utils.h"
|
||||
|
||||
|
@ -18,9 +19,9 @@ namespace {
|
|||
const char* AppCommandToString(int command_id) {
|
||||
switch (command_id) {
|
||||
case APPCOMMAND_BROWSER_BACKWARD:
|
||||
return "browser-backward";
|
||||
return kBrowserBackward;
|
||||
case APPCOMMAND_BROWSER_FORWARD:
|
||||
return "browser-forward";
|
||||
return kBrowserForward;
|
||||
case APPCOMMAND_BROWSER_REFRESH:
|
||||
return "browser-refresh";
|
||||
case APPCOMMAND_BROWSER_STOP:
|
||||
|
@ -141,7 +142,7 @@ HHOOK NativeWindowViews::mouse_hook_ = NULL;
|
|||
|
||||
bool NativeWindowViews::ExecuteWindowsCommand(int command_id) {
|
||||
std::string command = AppCommandToString(command_id);
|
||||
NotifyWindowExecuteWindowsCommand(command);
|
||||
NotifyWindowExecuteAppCommand(command);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue