feat: add support for preventing the system context menu (#25795)
This commit is contained in:
parent
042d25e926
commit
6d5cf02abd
7 changed files with 36 additions and 0 deletions
|
@ -294,6 +294,12 @@ void BaseWindow::OnNewWindowForTab() {
|
|||
Emit("new-window-for-tab");
|
||||
}
|
||||
|
||||
void BaseWindow::OnSystemContextMenu(int x, int y, bool* prevent_default) {
|
||||
if (Emit("system-context-menu", gfx::Point(x, y))) {
|
||||
*prevent_default = true;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
void BaseWindow::OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) {
|
||||
if (IsWindowMessageHooked(message)) {
|
||||
|
|
|
@ -82,6 +82,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
|||
void OnTouchBarItemResult(const std::string& item_id,
|
||||
const base::DictionaryValue& details) override;
|
||||
void OnNewWindowForTab() override;
|
||||
void OnSystemContextMenu(int x, int y, bool* prevent_default) override;
|
||||
#if defined(OS_WIN)
|
||||
void OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) override;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue