Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 #include "core/editing/InputMethodController.h" | 46 #include "core/editing/InputMethodController.h" |
| 47 #include "core/editing/iterators/TextIterator.h" | 47 #include "core/editing/iterators/TextIterator.h" |
| 48 #include "core/editing/serializers/HTMLInterchange.h" | 48 #include "core/editing/serializers/HTMLInterchange.h" |
| 49 #include "core/editing/serializers/Serialization.h" | 49 #include "core/editing/serializers/Serialization.h" |
| 50 #include "core/events/KeyboardEvent.h" | 50 #include "core/events/KeyboardEvent.h" |
| 51 #include "core/events/UIEventWithKeyState.h" | 51 #include "core/events/UIEventWithKeyState.h" |
| 52 #include "core/events/WebInputEventConversion.h" | 52 #include "core/events/WebInputEventConversion.h" |
| 53 #include "core/events/WheelEvent.h" | 53 #include "core/events/WheelEvent.h" |
| 54 #include "core/exported/WebPluginContainerBase.h" | 54 #include "core/exported/WebPluginContainerBase.h" |
| 55 #include "core/frame/BrowserControls.h" | 55 #include "core/frame/BrowserControls.h" |
| 56 #include "core/frame/ContextMenuAllowedScope.h" | |
| 56 #include "core/frame/EventHandlerRegistry.h" | 57 #include "core/frame/EventHandlerRegistry.h" |
| 57 #include "core/frame/FrameView.h" | 58 #include "core/frame/FrameView.h" |
| 58 #include "core/frame/LocalFrame.h" | 59 #include "core/frame/LocalFrame.h" |
| 59 #include "core/frame/LocalFrameClient.h" | 60 #include "core/frame/LocalFrameClient.h" |
| 60 #include "core/frame/PageScaleConstraintsSet.h" | 61 #include "core/frame/PageScaleConstraintsSet.h" |
| 61 #include "core/frame/RemoteFrame.h" | 62 #include "core/frame/RemoteFrame.h" |
| 62 #include "core/frame/ResizeViewportAnchor.h" | 63 #include "core/frame/ResizeViewportAnchor.h" |
| 63 #include "core/frame/RotationViewportAnchor.h" | 64 #include "core/frame/RotationViewportAnchor.h" |
| 64 #include "core/frame/Settings.h" | 65 #include "core/frame/Settings.h" |
| 65 #include "core/frame/UseCounter.h" | 66 #include "core/frame/UseCounter.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 #include "public/web/WebPlugin.h" | 155 #include "public/web/WebPlugin.h" |
| 155 #include "public/web/WebPluginAction.h" | 156 #include "public/web/WebPluginAction.h" |
| 156 #include "public/web/WebRange.h" | 157 #include "public/web/WebRange.h" |
| 157 #include "public/web/WebScopedUserGesture.h" | 158 #include "public/web/WebScopedUserGesture.h" |
| 158 #include "public/web/WebSelection.h" | 159 #include "public/web/WebSelection.h" |
| 159 #include "public/web/WebViewClient.h" | 160 #include "public/web/WebViewClient.h" |
| 160 #include "public/web/WebWindowFeatures.h" | 161 #include "public/web/WebWindowFeatures.h" |
| 161 #include "web/AnimationWorkletProxyClientImpl.h" | 162 #include "web/AnimationWorkletProxyClientImpl.h" |
| 162 #include "web/CompositorMutatorImpl.h" | 163 #include "web/CompositorMutatorImpl.h" |
| 163 #include "web/CompositorWorkerProxyClientImpl.h" | 164 #include "web/CompositorWorkerProxyClientImpl.h" |
| 164 #include "web/ContextMenuAllowedScope.h" | |
| 165 #include "web/DedicatedWorkerMessagingProxyProviderImpl.h" | 165 #include "web/DedicatedWorkerMessagingProxyProviderImpl.h" |
| 166 #include "web/DevToolsEmulator.h" | 166 #include "web/DevToolsEmulator.h" |
| 167 #include "web/FullscreenController.h" | 167 #include "web/FullscreenController.h" |
| 168 #include "web/LinkHighlightImpl.h" | 168 #include "web/LinkHighlightImpl.h" |
| 169 #include "web/PageOverlay.h" | 169 #include "web/PageOverlay.h" |
| 170 #include "web/PrerendererClientImpl.h" | 170 #include "web/PrerendererClientImpl.h" |
| 171 #include "web/StorageQuotaClientImpl.h" | 171 #include "web/StorageQuotaClientImpl.h" |
| 172 #include "web/WebDevToolsAgentImpl.h" | 172 #include "web/WebDevToolsAgentImpl.h" |
| 173 #include "web/WebInputMethodControllerImpl.h" | 173 #include "web/WebInputMethodControllerImpl.h" |
| 174 #include "web/WebLocalFrameImpl.h" | 174 #include "web/WebLocalFrameImpl.h" |
| (...skipping 3325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3500 if (!menu) | 3500 if (!menu) |
| 3501 return; | 3501 return; |
| 3502 const ContextMenuItem* item = menu->ItemWithAction( | 3502 const ContextMenuItem* item = menu->ItemWithAction( |
| 3503 static_cast<ContextMenuAction>(kContextMenuItemBaseCustomTag + action)); | 3503 static_cast<ContextMenuAction>(kContextMenuItemBaseCustomTag + action)); |
| 3504 if (item) | 3504 if (item) |
| 3505 page_->GetContextMenuController().ContextMenuItemSelected(item); | 3505 page_->GetContextMenuController().ContextMenuItemSelected(item); |
| 3506 page_->GetContextMenuController().ClearContextMenu(); | 3506 page_->GetContextMenuController().ClearContextMenu(); |
| 3507 } | 3507 } |
| 3508 | 3508 |
| 3509 void WebViewImpl::ShowContextMenu() { | 3509 void WebViewImpl::ShowContextMenu() { |
| 3510 if (!GetPage()) | 3510 NOTREACHED(); |
|
EhsanK
2017/05/23 22:31:23
To me it looks like this could in fact hit. Here i
wjmaclean
2017/05/24 13:05:52
So then, would the previous patchset of this CL, i
| |
| 3511 return; | |
| 3512 | |
| 3513 GetPage()->GetContextMenuController().ClearContextMenu(); | |
| 3514 { | |
| 3515 ContextMenuAllowedScope scope; | |
| 3516 if (LocalFrame* focused_frame = | |
| 3517 ToLocalFrame(GetPage()->GetFocusController().FocusedOrMainFrame())) | |
| 3518 focused_frame->GetEventHandler().SendContextMenuEventForKey(nullptr); | |
| 3519 } | |
| 3520 } | 3511 } |
| 3521 | 3512 |
| 3522 void WebViewImpl::DidCloseContextMenu() { | 3513 void WebViewImpl::DidCloseContextMenu() { |
| 3523 LocalFrame* frame = page_->GetFocusController().FocusedFrame(); | 3514 LocalFrame* frame = page_->GetFocusController().FocusedFrame(); |
| 3524 if (frame) | 3515 if (frame) |
| 3525 frame->Selection().SetCaretBlinkingSuspended(false); | 3516 frame->Selection().SetCaretBlinkingSuspended(false); |
| 3526 } | 3517 } |
| 3527 | 3518 |
| 3528 void WebViewImpl::HidePopups() { | 3519 void WebViewImpl::HidePopups() { |
| 3529 CancelPagePopup(); | 3520 CancelPagePopup(); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4162 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4153 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
| 4163 return nullptr; | 4154 return nullptr; |
| 4164 return focused_frame; | 4155 return focused_frame; |
| 4165 } | 4156 } |
| 4166 | 4157 |
| 4167 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4158 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
| 4168 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4159 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
| 4169 } | 4160 } |
| 4170 | 4161 |
| 4171 } // namespace blink | 4162 } // namespace blink |
| OLD | NEW |