| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index cef65a924bd6e3cc1036361d9f338427a92ec0de..c2f9e1428ece304886840c3fe21c27a19d43ed91 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -516,6 +516,7 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
|
| #endif // !defined(OS_ANDROID)
|
| mouse_lock_widget_(nullptr),
|
| is_overlay_content_(false),
|
| + showing_context_menu_(false),
|
| loading_weak_factory_(this),
|
| weak_factory_(this) {
|
| frame_tree_.SetFrameRemoveListener(
|
| @@ -4400,7 +4401,7 @@ void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host,
|
| const ContextMenuParams& params) {
|
| // If a renderer fires off a second command to show a context menu before the
|
| // first context menu is closed, just ignore it. https://crbug.com/707534
|
| - if (GetRenderWidgetHostView()->IsShowingContextMenu())
|
| + if (showing_context_menu_)
|
| return;
|
|
|
| ContextMenuParams context_menu_params(params);
|
| @@ -4514,6 +4515,21 @@ bool WebContentsImpl::IsFocusedElementEditable() {
|
| return frame && frame->has_focused_editable_element();
|
| }
|
|
|
| +bool WebContentsImpl::IsShowingContextMenu() const {
|
| + return showing_context_menu_;
|
| +}
|
| +
|
| +void WebContentsImpl::SetShowingContextMenu(bool showing) {
|
| + DCHECK_NE(showing_context_menu_, showing);
|
| + showing_context_menu_ = showing;
|
| +
|
| + if (auto* view = GetRenderWidgetHostView()) {
|
| + // Notify the main frame's RWHV to run the platform-specific code, if any.
|
| + static_cast<RenderWidgetHostViewBase*>(view)->SetShowingContextMenu(
|
| + showing);
|
| + }
|
| +}
|
| +
|
| void WebContentsImpl::ClearFocusedElement() {
|
| if (auto* frame = GetFocusedFrame())
|
| frame->ClearFocusedElement();
|
| @@ -5666,6 +5682,10 @@ void WebContentsImpl::ShowInsecureLocalhostWarningIfNeeded() {
|
| " releasing your website to the public."));
|
| }
|
|
|
| +bool WebContentsImpl::IsShowingContextMenuOnPage() const {
|
| + return showing_context_menu_;
|
| +}
|
| +
|
| void WebContentsImpl::NotifyPreferencesChanged() {
|
| std::set<RenderViewHost*> render_view_host_set;
|
| for (FrameTreeNode* node : frame_tree_.Nodes()) {
|
|
|