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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 #include "public/web/WebViewClient.h" | 153 #include "public/web/WebViewClient.h" |
154 #include "public/web/WebWindowFeatures.h" | 154 #include "public/web/WebWindowFeatures.h" |
155 #include "web/AnimationWorkletProxyClientImpl.h" | 155 #include "web/AnimationWorkletProxyClientImpl.h" |
156 #include "web/CompositionUnderlineVectorBuilder.h" | 156 #include "web/CompositionUnderlineVectorBuilder.h" |
157 #include "web/CompositorMutatorImpl.h" | 157 #include "web/CompositorMutatorImpl.h" |
158 #include "web/CompositorWorkerProxyClientImpl.h" | 158 #include "web/CompositorWorkerProxyClientImpl.h" |
159 #include "web/ContextMenuAllowedScope.h" | 159 #include "web/ContextMenuAllowedScope.h" |
160 #include "web/DedicatedWorkerMessagingProxyProviderImpl.h" | 160 #include "web/DedicatedWorkerMessagingProxyProviderImpl.h" |
161 #include "web/DevToolsEmulator.h" | 161 #include "web/DevToolsEmulator.h" |
162 #include "web/FullscreenController.h" | 162 #include "web/FullscreenController.h" |
163 #include "web/InspectorOverlayAgent.h" | 163 #include "web/InspectorOverlay.h" |
164 #include "web/LinkHighlightImpl.h" | 164 #include "web/LinkHighlightImpl.h" |
165 #include "web/PageOverlay.h" | 165 #include "web/PageOverlay.h" |
166 #include "web/PrerendererClientImpl.h" | 166 #include "web/PrerendererClientImpl.h" |
167 #include "web/ResizeViewportAnchor.h" | 167 #include "web/ResizeViewportAnchor.h" |
168 #include "web/RotationViewportAnchor.h" | 168 #include "web/RotationViewportAnchor.h" |
169 #include "web/SpeechRecognitionClientProxy.h" | 169 #include "web/SpeechRecognitionClientProxy.h" |
170 #include "web/StorageQuotaClientImpl.h" | 170 #include "web/StorageQuotaClientImpl.h" |
171 #include "web/ValidationMessageClientImpl.h" | 171 #include "web/ValidationMessageClientImpl.h" |
172 #include "web/WebDevToolsAgentImpl.h" | 172 #include "web/WebDevToolsAgentImpl.h" |
173 #include "web/WebInputEventConversion.h" | 173 #include "web/WebInputEventConversion.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 // in destructor. m_linkHighlightsTimeline might be destroyed earlier | 426 // in destructor. m_linkHighlightsTimeline might be destroyed earlier |
427 // than m_linkHighlights. | 427 // than m_linkHighlights. |
428 DCHECK(link_highlights_.IsEmpty()); | 428 DCHECK(link_highlights_.IsEmpty()); |
429 } | 429 } |
430 | 430 |
431 WebDevToolsAgentImpl* WebViewImpl::MainFrameDevToolsAgentImpl() { | 431 WebDevToolsAgentImpl* WebViewImpl::MainFrameDevToolsAgentImpl() { |
432 WebLocalFrameImpl* main_frame = MainFrameImpl(); | 432 WebLocalFrameImpl* main_frame = MainFrameImpl(); |
433 return main_frame ? main_frame->DevToolsAgentImpl() : nullptr; | 433 return main_frame ? main_frame->DevToolsAgentImpl() : nullptr; |
434 } | 434 } |
435 | 435 |
436 InspectorOverlayAgent* WebViewImpl::GetInspectorOverlay() { | 436 InspectorOverlay* WebViewImpl::GetInspectorOverlay() { |
437 if (WebDevToolsAgentImpl* devtools = MainFrameDevToolsAgentImpl()) | 437 if (WebDevToolsAgentImpl* devtools = MainFrameDevToolsAgentImpl()) |
438 return devtools->OverlayAgent(); | 438 return devtools->Overlay(); |
439 return nullptr; | 439 return nullptr; |
440 } | 440 } |
441 | 441 |
442 WebLocalFrameImpl* WebViewImpl::MainFrameImpl() const { | 442 WebLocalFrameImpl* WebViewImpl::MainFrameImpl() const { |
443 return page_ && page_->MainFrame() && page_->MainFrame()->IsLocalFrame() | 443 return page_ && page_->MainFrame() && page_->MainFrame()->IsLocalFrame() |
444 ? WebLocalFrameImpl::FromFrame(page_->DeprecatedLocalMainFrame()) | 444 ? WebLocalFrameImpl::FromFrame(page_->DeprecatedLocalMainFrame()) |
445 : nullptr; | 445 : nullptr; |
446 } | 446 } |
447 | 447 |
448 bool WebViewImpl::TabKeyCyclesThroughElements() const { | 448 bool WebViewImpl::TabKeyCyclesThroughElements() const { |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 if (!MainFrameImpl()) | 2025 if (!MainFrameImpl()) |
2026 return; | 2026 return; |
2027 | 2027 |
2028 DocumentLifecycle::AllowThrottlingScope throttling_scope( | 2028 DocumentLifecycle::AllowThrottlingScope throttling_scope( |
2029 MainFrameImpl()->GetFrame()->GetDocument()->Lifecycle()); | 2029 MainFrameImpl()->GetFrame()->GetDocument()->Lifecycle()); |
2030 UpdateLayerTreeBackgroundColor(); | 2030 UpdateLayerTreeBackgroundColor(); |
2031 | 2031 |
2032 PageWidgetDelegate::UpdateAllLifecyclePhases(*page_, | 2032 PageWidgetDelegate::UpdateAllLifecyclePhases(*page_, |
2033 *MainFrameImpl()->GetFrame()); | 2033 *MainFrameImpl()->GetFrame()); |
2034 | 2034 |
2035 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) { | 2035 if (InspectorOverlay* overlay = GetInspectorOverlay()) { |
2036 overlay->UpdateAllLifecyclePhases(); | 2036 overlay->UpdateAllLifecyclePhases(); |
2037 // TODO(chrishtr): integrate paint into the overlay's lifecycle. | 2037 // TODO(chrishtr): integrate paint into the overlay's lifecycle. |
2038 if (overlay->GetPageOverlay() && | 2038 if (overlay->GetPageOverlay() && |
2039 overlay->GetPageOverlay()->GetGraphicsLayer()) | 2039 overlay->GetPageOverlay()->GetGraphicsLayer()) |
2040 overlay->GetPageOverlay()->GetGraphicsLayer()->Paint(nullptr); | 2040 overlay->GetPageOverlay()->GetGraphicsLayer()->Paint(nullptr); |
2041 } | 2041 } |
2042 if (page_color_overlay_) | 2042 if (page_color_overlay_) |
2043 page_color_overlay_->GetGraphicsLayer()->Paint(nullptr); | 2043 page_color_overlay_->GetGraphicsLayer()->Paint(nullptr); |
2044 | 2044 |
2045 // TODO(chrishtr): link highlights don't currently paint themselves, it's | 2045 // TODO(chrishtr): link highlights don't currently paint themselves, it's |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 TRACE_EVENT1("input,rail", "WebViewImpl::handleInputEvent", "type", | 2168 TRACE_EVENT1("input,rail", "WebViewImpl::handleInputEvent", "type", |
2169 WebInputEvent::GetName(input_event.GetType())); | 2169 WebInputEvent::GetName(input_event.GetType())); |
2170 | 2170 |
2171 // If a drag-and-drop operation is in progress, ignore input events. | 2171 // If a drag-and-drop operation is in progress, ignore input events. |
2172 if (MainFrameImpl()->FrameWidget()->DoingDragAndDrop()) | 2172 if (MainFrameImpl()->FrameWidget()->DoingDragAndDrop()) |
2173 return WebInputEventResult::kHandledSuppressed; | 2173 return WebInputEventResult::kHandledSuppressed; |
2174 | 2174 |
2175 if (dev_tools_emulator_->HandleInputEvent(input_event)) | 2175 if (dev_tools_emulator_->HandleInputEvent(input_event)) |
2176 return WebInputEventResult::kHandledSuppressed; | 2176 return WebInputEventResult::kHandledSuppressed; |
2177 | 2177 |
2178 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) { | 2178 if (InspectorOverlay* overlay = GetInspectorOverlay()) { |
2179 if (overlay->HandleInputEvent(input_event)) | 2179 if (overlay->HandleInputEvent(input_event)) |
2180 return WebInputEventResult::kHandledSuppressed; | 2180 return WebInputEventResult::kHandledSuppressed; |
2181 } | 2181 } |
2182 | 2182 |
2183 // Report the event to be NOT processed by WebKit, so that the browser can | 2183 // Report the event to be NOT processed by WebKit, so that the browser can |
2184 // handle it appropriately. | 2184 // handle it appropriately. |
2185 if (WebFrameWidgetBase::IgnoreInputEvents()) | 2185 if (WebFrameWidgetBase::IgnoreInputEvents()) |
2186 return WebInputEventResult::kNotHandled; | 2186 return WebInputEventResult::kNotHandled; |
2187 | 2187 |
2188 AutoReset<const WebInputEvent*> current_event_change(¤t_input_event_, | 2188 AutoReset<const WebInputEvent*> current_event_change(¤t_input_event_, |
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4131 return new CompositorWorkerProxyClientImpl(&Mutator()); | 4131 return new CompositorWorkerProxyClientImpl(&Mutator()); |
4132 } | 4132 } |
4133 | 4133 |
4134 AnimationWorkletProxyClient* WebViewImpl::CreateAnimationWorkletProxyClient() { | 4134 AnimationWorkletProxyClient* WebViewImpl::CreateAnimationWorkletProxyClient() { |
4135 return new AnimationWorkletProxyClientImpl(&Mutator()); | 4135 return new AnimationWorkletProxyClientImpl(&Mutator()); |
4136 } | 4136 } |
4137 | 4137 |
4138 void WebViewImpl::UpdatePageOverlays() { | 4138 void WebViewImpl::UpdatePageOverlays() { |
4139 if (page_color_overlay_) | 4139 if (page_color_overlay_) |
4140 page_color_overlay_->Update(); | 4140 page_color_overlay_->Update(); |
4141 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) { | 4141 if (InspectorOverlay* overlay = GetInspectorOverlay()) { |
4142 PageOverlay* inspector_page_overlay = overlay->GetPageOverlay(); | 4142 PageOverlay* inspector_page_overlay = overlay->GetPageOverlay(); |
4143 if (inspector_page_overlay) | 4143 if (inspector_page_overlay) |
4144 inspector_page_overlay->Update(); | 4144 inspector_page_overlay->Update(); |
4145 } | 4145 } |
4146 } | 4146 } |
4147 | 4147 |
4148 float WebViewImpl::DeviceScaleFactor() const { | 4148 float WebViewImpl::DeviceScaleFactor() const { |
4149 // TODO(oshima): Investigate if this should return the ScreenInfo's scale | 4149 // TODO(oshima): Investigate if this should return the ScreenInfo's scale |
4150 // factor rather than page's scale factor, which can be 1 in use-zoom-for-dsf | 4150 // factor rather than page's scale factor, which can be 1 in use-zoom-for-dsf |
4151 // mode. | 4151 // mode. |
(...skipping 11 matching lines...) Expand all Loading... |
4163 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4163 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
4164 return nullptr; | 4164 return nullptr; |
4165 return focused_frame; | 4165 return focused_frame; |
4166 } | 4166 } |
4167 | 4167 |
4168 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4168 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
4169 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4169 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
4170 } | 4170 } |
4171 | 4171 |
4172 } // namespace blink | 4172 } // namespace blink |
OLD | NEW |