| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 28 matching lines...) Expand all Loading... |
| 39 #include "core/editing/FrameSelection.h" | 39 #include "core/editing/FrameSelection.h" |
| 40 #include "core/editing/InputMethodController.h" | 40 #include "core/editing/InputMethodController.h" |
| 41 #include "core/editing/PlainTextRange.h" | 41 #include "core/editing/PlainTextRange.h" |
| 42 #include "core/events/WebInputEventConversion.h" | 42 #include "core/events/WebInputEventConversion.h" |
| 43 #include "core/exported/WebPluginContainerBase.h" | 43 #include "core/exported/WebPluginContainerBase.h" |
| 44 #include "core/exported/WebViewBase.h" | 44 #include "core/exported/WebViewBase.h" |
| 45 #include "core/frame/LocalFrameView.h" | 45 #include "core/frame/LocalFrameView.h" |
| 46 #include "core/frame/RemoteFrame.h" | 46 #include "core/frame/RemoteFrame.h" |
| 47 #include "core/frame/Settings.h" | 47 #include "core/frame/Settings.h" |
| 48 #include "core/frame/VisualViewport.h" | 48 #include "core/frame/VisualViewport.h" |
| 49 #include "core/frame/WebLocalFrameBase.h" |
| 49 #include "core/html/HTMLTextAreaElement.h" | 50 #include "core/html/HTMLTextAreaElement.h" |
| 50 #include "core/input/ContextMenuAllowedScope.h" | 51 #include "core/input/ContextMenuAllowedScope.h" |
| 51 #include "core/input/EventHandler.h" | 52 #include "core/input/EventHandler.h" |
| 52 #include "core/layout/LayoutView.h" | 53 #include "core/layout/LayoutView.h" |
| 53 #include "core/layout/api/LayoutViewItem.h" | 54 #include "core/layout/api/LayoutViewItem.h" |
| 54 #include "core/layout/compositing/PaintLayerCompositor.h" | 55 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 55 #include "core/page/ContextMenuController.h" | 56 #include "core/page/ContextMenuController.h" |
| 56 #include "core/page/FocusController.h" | 57 #include "core/page/FocusController.h" |
| 57 #include "core/page/Page.h" | 58 #include "core/page/Page.h" |
| 58 #include "core/page/PointerLockController.h" | 59 #include "core/page/PointerLockController.h" |
| 59 #include "platform/KeyboardCodes.h" | 60 #include "platform/KeyboardCodes.h" |
| 60 #include "platform/WebFrameScheduler.h" | 61 #include "platform/WebFrameScheduler.h" |
| 61 #include "platform/animation/CompositorAnimationHost.h" | 62 #include "platform/animation/CompositorAnimationHost.h" |
| 62 #include "platform/graphics/Color.h" | 63 #include "platform/graphics/Color.h" |
| 63 #include "platform/graphics/CompositorMutatorClient.h" | 64 #include "platform/graphics/CompositorMutatorClient.h" |
| 64 #include "platform/wtf/AutoReset.h" | 65 #include "platform/wtf/AutoReset.h" |
| 65 #include "platform/wtf/PtrUtil.h" | 66 #include "platform/wtf/PtrUtil.h" |
| 66 #include "public/web/WebAutofillClient.h" | 67 #include "public/web/WebAutofillClient.h" |
| 67 #include "public/web/WebPlugin.h" | 68 #include "public/web/WebPlugin.h" |
| 68 #include "public/web/WebRange.h" | 69 #include "public/web/WebRange.h" |
| 69 #include "public/web/WebWidgetClient.h" | 70 #include "public/web/WebWidgetClient.h" |
| 70 #include "web/AnimationWorkletProxyClientImpl.h" | 71 #include "web/AnimationWorkletProxyClientImpl.h" |
| 71 #include "web/CompositorMutatorImpl.h" | 72 #include "web/CompositorMutatorImpl.h" |
| 72 #include "web/CompositorWorkerProxyClientImpl.h" | 73 #include "web/CompositorWorkerProxyClientImpl.h" |
| 73 #include "web/WebDevToolsAgentImpl.h" | 74 #include "web/WebDevToolsAgentImpl.h" |
| 74 #include "web/WebInputMethodControllerImpl.h" | 75 #include "web/WebInputMethodControllerImpl.h" |
| 75 #include "web/WebLocalFrameImpl.h" | |
| 76 #include "web/WebPagePopupImpl.h" | 76 #include "web/WebPagePopupImpl.h" |
| 77 #include "web/WebRemoteFrameImpl.h" | 77 #include "web/WebRemoteFrameImpl.h" |
| 78 #include "web/WebViewFrameWidget.h" | 78 #include "web/WebViewFrameWidget.h" |
| 79 | 79 |
| 80 namespace blink { | 80 namespace blink { |
| 81 | 81 |
| 82 // WebFrameWidget ------------------------------------------------------------ | 82 // WebFrameWidget ------------------------------------------------------------ |
| 83 | 83 |
| 84 WebFrameWidget* WebFrameWidget::Create(WebWidgetClient* client, | 84 WebFrameWidget* WebFrameWidget::Create(WebWidgetClient* client, |
| 85 WebLocalFrame* local_root) { | 85 WebLocalFrame* local_root) { |
| 86 DCHECK(client) << "A valid WebWidgetClient must be supplied."; | 86 DCHECK(client) << "A valid WebWidgetClient must be supplied."; |
| 87 // Pass the WebFrameWidget's self-reference to the caller. | 87 // Pass the WebFrameWidget's self-reference to the caller. |
| 88 return WebFrameWidgetImpl::Create(client, local_root); | 88 return WebFrameWidgetImpl::Create(client, local_root); |
| 89 } | 89 } |
| 90 | 90 |
| 91 WebFrameWidget* WebFrameWidget::Create(WebWidgetClient* client, | 91 WebFrameWidget* WebFrameWidget::Create(WebWidgetClient* client, |
| 92 WebView* web_view, | 92 WebView* web_view, |
| 93 WebLocalFrame* main_frame) { | 93 WebLocalFrame* main_frame) { |
| 94 DCHECK(client) << "A valid WebWidgetClient must be supplied."; | 94 DCHECK(client) << "A valid WebWidgetClient must be supplied."; |
| 95 return new WebViewFrameWidget(*client, static_cast<WebViewBase&>(*web_view), | 95 return new WebViewFrameWidget(*client, static_cast<WebViewBase&>(*web_view), |
| 96 ToWebLocalFrameImpl(*main_frame)); | 96 ToWebLocalFrameBase(*main_frame)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 WebFrameWidgetImpl* WebFrameWidgetImpl::Create(WebWidgetClient* client, | 99 WebFrameWidgetImpl* WebFrameWidgetImpl::Create(WebWidgetClient* client, |
| 100 WebLocalFrame* local_root) { | 100 WebLocalFrame* local_root) { |
| 101 DCHECK(client) << "A valid WebWidgetClient must be supplied."; | 101 DCHECK(client) << "A valid WebWidgetClient must be supplied."; |
| 102 // Pass the WebFrameWidgetImpl's self-reference to the caller. | 102 // Pass the WebFrameWidgetImpl's self-reference to the caller. |
| 103 return new WebFrameWidgetImpl( | 103 return new WebFrameWidgetImpl( |
| 104 client, local_root); // SelfKeepAlive is set in constructor. | 104 client, local_root); // SelfKeepAlive is set in constructor. |
| 105 } | 105 } |
| 106 | 106 |
| 107 WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, | 107 WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, |
| 108 WebLocalFrame* local_root) | 108 WebLocalFrame* local_root) |
| 109 : client_(client), | 109 : client_(client), |
| 110 local_root_(ToWebLocalFrameImpl(local_root)), | 110 local_root_(ToWebLocalFrameBase(local_root)), |
| 111 mutator_(nullptr), | 111 mutator_(nullptr), |
| 112 layer_tree_view_(nullptr), | 112 layer_tree_view_(nullptr), |
| 113 root_layer_(nullptr), | 113 root_layer_(nullptr), |
| 114 root_graphics_layer_(nullptr), | 114 root_graphics_layer_(nullptr), |
| 115 is_accelerated_compositing_active_(false), | 115 is_accelerated_compositing_active_(false), |
| 116 layer_tree_view_closed_(false), | 116 layer_tree_view_closed_(false), |
| 117 suppress_next_keypress_event_(false), | 117 suppress_next_keypress_event_(false), |
| 118 background_color_override_enabled_(false), | 118 background_color_override_enabled_(false), |
| 119 background_color_override_(Color::kTransparent), | 119 background_color_override_(Color::kTransparent), |
| 120 base_background_color_override_enabled_(false), | 120 base_background_color_override_enabled_(false), |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 bool WebFrameWidgetImpl::GetCompositionCharacterBounds( | 740 bool WebFrameWidgetImpl::GetCompositionCharacterBounds( |
| 741 WebVector<WebRect>& bounds) { | 741 WebVector<WebRect>& bounds) { |
| 742 WebRange range = CompositionRange(); | 742 WebRange range = CompositionRange(); |
| 743 if (range.IsEmpty()) | 743 if (range.IsEmpty()) |
| 744 return false; | 744 return false; |
| 745 | 745 |
| 746 LocalFrame* frame = FocusedLocalFrameInWidget(); | 746 LocalFrame* frame = FocusedLocalFrameInWidget(); |
| 747 if (!frame) | 747 if (!frame) |
| 748 return false; | 748 return false; |
| 749 | 749 |
| 750 WebLocalFrameImpl* web_local_frame = WebLocalFrameImpl::FromFrame(frame); | 750 WebLocalFrameBase* web_local_frame = WebLocalFrameBase::FromFrame(frame); |
| 751 size_t character_count = range.length(); | 751 size_t character_count = range.length(); |
| 752 size_t offset = range.StartOffset(); | 752 size_t offset = range.StartOffset(); |
| 753 WebVector<WebRect> result(character_count); | 753 WebVector<WebRect> result(character_count); |
| 754 WebRect webrect; | 754 WebRect webrect; |
| 755 for (size_t i = 0; i < character_count; ++i) { | 755 for (size_t i = 0; i < character_count; ++i) { |
| 756 if (!web_local_frame->FirstRectForCharacterRange(offset + i, 1, webrect)) { | 756 if (!web_local_frame->FirstRectForCharacterRange(offset + i, 1, webrect)) { |
| 757 DLOG(ERROR) << "Could not retrieve character rectangle at " << i; | 757 DLOG(ERROR) << "Could not retrieve character rectangle at " << i; |
| 758 return false; | 758 return false; |
| 759 } | 759 } |
| 760 result[i] = webrect; | 760 result[i] = webrect; |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 : nullptr; | 1198 : nullptr; |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameAvailableForIme() const { | 1201 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameAvailableForIme() const { |
| 1202 if (!ime_accept_events_) | 1202 if (!ime_accept_events_) |
| 1203 return nullptr; | 1203 return nullptr; |
| 1204 return FocusedLocalFrameInWidget(); | 1204 return FocusedLocalFrameInWidget(); |
| 1205 } | 1205 } |
| 1206 | 1206 |
| 1207 } // namespace blink | 1207 } // namespace blink |
| OLD | NEW |