| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 #include "platform/wtf/AutoReset.h" | 127 #include "platform/wtf/AutoReset.h" |
| 128 #include "platform/wtf/CurrentTime.h" | 128 #include "platform/wtf/CurrentTime.h" |
| 129 #include "platform/wtf/PtrUtil.h" | 129 #include "platform/wtf/PtrUtil.h" |
| 130 #include "platform/wtf/RefPtr.h" | 130 #include "platform/wtf/RefPtr.h" |
| 131 #include "public/platform/Platform.h" | 131 #include "public/platform/Platform.h" |
| 132 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" | 132 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" |
| 133 #include "public/platform/WebCompositorSupport.h" | 133 #include "public/platform/WebCompositorSupport.h" |
| 134 #include "public/platform/WebFloatPoint.h" | 134 #include "public/platform/WebFloatPoint.h" |
| 135 #include "public/platform/WebGestureCurve.h" | 135 #include "public/platform/WebGestureCurve.h" |
| 136 #include "public/platform/WebImage.h" | 136 #include "public/platform/WebImage.h" |
| 137 #include "public/platform/WebInputEvent.h" |
| 137 #include "public/platform/WebLayerTreeView.h" | 138 #include "public/platform/WebLayerTreeView.h" |
| 138 #include "public/platform/WebTextInputInfo.h" | 139 #include "public/platform/WebTextInputInfo.h" |
| 139 #include "public/platform/WebURLRequest.h" | 140 #include "public/platform/WebURLRequest.h" |
| 140 #include "public/platform/WebVector.h" | 141 #include "public/platform/WebVector.h" |
| 141 #include "public/web/WebAXObject.h" | 142 #include "public/web/WebAXObject.h" |
| 142 #include "public/web/WebActiveWheelFlingParameters.h" | 143 #include "public/web/WebActiveWheelFlingParameters.h" |
| 143 #include "public/web/WebAutofillClient.h" | 144 #include "public/web/WebAutofillClient.h" |
| 144 #include "public/web/WebConsoleMessage.h" | 145 #include "public/web/WebConsoleMessage.h" |
| 145 #include "public/web/WebElement.h" | 146 #include "public/web/WebElement.h" |
| 146 #include "public/web/WebFrame.h" | 147 #include "public/web/WebFrame.h" |
| 147 #include "public/web/WebFrameClient.h" | 148 #include "public/web/WebFrameClient.h" |
| 148 #include "public/web/WebFrameWidget.h" | 149 #include "public/web/WebFrameWidget.h" |
| 149 #include "public/web/WebHitTestResult.h" | 150 #include "public/web/WebHitTestResult.h" |
| 150 #include "public/web/WebInputElement.h" | 151 #include "public/web/WebInputElement.h" |
| 151 #include "public/web/WebMeaningfulLayout.h" | 152 #include "public/web/WebMeaningfulLayout.h" |
| 152 #include "public/web/WebMediaPlayerAction.h" | 153 #include "public/web/WebMediaPlayerAction.h" |
| 154 #include "public/web/WebMenuSourceType.h" |
| 153 #include "public/web/WebNode.h" | 155 #include "public/web/WebNode.h" |
| 154 #include "public/web/WebPlugin.h" | 156 #include "public/web/WebPlugin.h" |
| 155 #include "public/web/WebPluginAction.h" | 157 #include "public/web/WebPluginAction.h" |
| 156 #include "public/web/WebRange.h" | 158 #include "public/web/WebRange.h" |
| 157 #include "public/web/WebScopedUserGesture.h" | 159 #include "public/web/WebScopedUserGesture.h" |
| 158 #include "public/web/WebSelection.h" | 160 #include "public/web/WebSelection.h" |
| 159 #include "public/web/WebViewClient.h" | 161 #include "public/web/WebViewClient.h" |
| 160 #include "public/web/WebWindowFeatures.h" | 162 #include "public/web/WebWindowFeatures.h" |
| 161 #include "web/AnimationWorkletProxyClientImpl.h" | 163 #include "web/AnimationWorkletProxyClientImpl.h" |
| 162 #include "web/CompositorMutatorImpl.h" | 164 #include "web/CompositorMutatorImpl.h" |
| (...skipping 3334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3497 ContextMenu* menu = page_->GetContextMenuController().GetContextMenu(); | 3499 ContextMenu* menu = page_->GetContextMenuController().GetContextMenu(); |
| 3498 if (!menu) | 3500 if (!menu) |
| 3499 return; | 3501 return; |
| 3500 const ContextMenuItem* item = menu->ItemWithAction( | 3502 const ContextMenuItem* item = menu->ItemWithAction( |
| 3501 static_cast<ContextMenuAction>(kContextMenuItemBaseCustomTag + action)); | 3503 static_cast<ContextMenuAction>(kContextMenuItemBaseCustomTag + action)); |
| 3502 if (item) | 3504 if (item) |
| 3503 page_->GetContextMenuController().ContextMenuItemSelected(item); | 3505 page_->GetContextMenuController().ContextMenuItemSelected(item); |
| 3504 page_->GetContextMenuController().ClearContextMenu(); | 3506 page_->GetContextMenuController().ClearContextMenu(); |
| 3505 } | 3507 } |
| 3506 | 3508 |
| 3507 void WebViewImpl::ShowContextMenu() { | 3509 void WebViewImpl::ShowContextMenu(WebMenuSourceType source_type) { |
| 3508 if (!GetPage()) | 3510 if (!GetPage()) |
| 3509 return; | 3511 return; |
| 3510 | 3512 |
| 3511 GetPage()->GetContextMenuController().ClearContextMenu(); | 3513 GetPage()->GetContextMenuController().ClearContextMenu(); |
| 3512 { | 3514 { |
| 3513 ContextMenuAllowedScope scope; | 3515 ContextMenuAllowedScope scope; |
| 3514 if (LocalFrame* focused_frame = | 3516 if (LocalFrame* focused_frame = ToLocalFrame( |
| 3515 ToLocalFrame(GetPage()->GetFocusController().FocusedOrMainFrame())) | 3517 GetPage()->GetFocusController().FocusedOrMainFrame())) { |
| 3516 focused_frame->GetEventHandler().SendContextMenuEventForKey(nullptr); | 3518 focused_frame->GetEventHandler().SendContextMenuEventForKey(nullptr, |
| 3519 source_type); |
| 3520 } |
| 3517 } | 3521 } |
| 3518 } | 3522 } |
| 3519 | 3523 |
| 3520 void WebViewImpl::DidCloseContextMenu() { | 3524 void WebViewImpl::DidCloseContextMenu() { |
| 3521 LocalFrame* frame = page_->GetFocusController().FocusedFrame(); | 3525 LocalFrame* frame = page_->GetFocusController().FocusedFrame(); |
| 3522 if (frame) | 3526 if (frame) |
| 3523 frame->Selection().SetCaretBlinkingSuspended(false); | 3527 frame->Selection().SetCaretBlinkingSuspended(false); |
| 3524 } | 3528 } |
| 3525 | 3529 |
| 3526 void WebViewImpl::HidePopups() { | 3530 void WebViewImpl::HidePopups() { |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4160 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4164 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
| 4161 return nullptr; | 4165 return nullptr; |
| 4162 return focused_frame; | 4166 return focused_frame; |
| 4163 } | 4167 } |
| 4164 | 4168 |
| 4165 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4169 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
| 4166 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4170 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
| 4167 } | 4171 } |
| 4168 | 4172 |
| 4169 } // namespace blink | 4173 } // namespace blink |
| OLD | NEW |