mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-12 09:37:37 +01:00
fe24ce3c71
The menu may not be running in the following cases: - If the menu is empty (e.g. cleared in OnBeforeContextMenu). - If the menu is disabled (see e.g. RenderViewContextMenuViews::Show). - When the run call blocks until the menu is dismissed (macOS behavior). We explicitly clean up in these cases instead of waiting for OnMenuClosed which will otherwise never be called for the first 2 cases. Menu run status is exposed via new ContextMenuDelegate and RenderViewContextMenuBase methods.
29 lines
848 B
C++
29 lines
848 B
C++
// Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights
|
|
// reserved. Use of this source code is governed by a BSD-style license that can
|
|
// be found in the LICENSE file.
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_CHROME_CHROME_CONTEXT_MENU_HANDLER_H_
|
|
#define CEF_LIBCEF_BROWSER_CHROME_CHROME_CONTEXT_MENU_HANDLER_H_
|
|
#pragma once
|
|
|
|
#include "content/public/browser/context_menu_params.h"
|
|
|
|
namespace content {
|
|
class WebContents;
|
|
}
|
|
|
|
namespace context_menu {
|
|
|
|
// Register RenderViewContextMenu callbacks.
|
|
void RegisterCallbacks();
|
|
|
|
// Returns true if the menu was handled.
|
|
bool HandleContextMenu(content::WebContents* opener,
|
|
const content::ContextMenuParams& params);
|
|
|
|
void MaybeResetContextMenu(content::WebContents* opener);
|
|
|
|
} // namespace context_menu
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_CONTEXT_MENU_HANDLER_H_
|