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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 #include "public/web/WebViewClient.h" | 155 #include "public/web/WebViewClient.h" |
156 #include "public/web/WebWindowFeatures.h" | 156 #include "public/web/WebWindowFeatures.h" |
157 #include "web/AnimationWorkletProxyClientImpl.h" | 157 #include "web/AnimationWorkletProxyClientImpl.h" |
158 #include "web/CompositionUnderlineVectorBuilder.h" | 158 #include "web/CompositionUnderlineVectorBuilder.h" |
159 #include "web/CompositorMutatorImpl.h" | 159 #include "web/CompositorMutatorImpl.h" |
160 #include "web/CompositorWorkerProxyClientImpl.h" | 160 #include "web/CompositorWorkerProxyClientImpl.h" |
161 #include "web/ContextMenuAllowedScope.h" | 161 #include "web/ContextMenuAllowedScope.h" |
162 #include "web/DedicatedWorkerMessagingProxyProviderImpl.h" | 162 #include "web/DedicatedWorkerMessagingProxyProviderImpl.h" |
163 #include "web/DevToolsEmulator.h" | 163 #include "web/DevToolsEmulator.h" |
164 #include "web/FullscreenController.h" | 164 #include "web/FullscreenController.h" |
165 #include "web/InspectorOverlay.h" | 165 #include "web/InspectorOverlayAgent.h" |
166 #include "web/LinkHighlightImpl.h" | 166 #include "web/LinkHighlightImpl.h" |
167 #include "web/PageOverlay.h" | 167 #include "web/PageOverlay.h" |
168 #include "web/PrerendererClientImpl.h" | 168 #include "web/PrerendererClientImpl.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" |
174 #include "web/WebInputMethodControllerImpl.h" | 174 #include "web/WebInputMethodControllerImpl.h" |
175 #include "web/WebLocalFrameImpl.h" | 175 #include "web/WebLocalFrameImpl.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 // in destructor. m_linkHighlightsTimeline might be destroyed earlier | 425 // in destructor. m_linkHighlightsTimeline might be destroyed earlier |
426 // than m_linkHighlights. | 426 // than m_linkHighlights. |
427 DCHECK(link_highlights_.IsEmpty()); | 427 DCHECK(link_highlights_.IsEmpty()); |
428 } | 428 } |
429 | 429 |
430 WebDevToolsAgentImpl* WebViewImpl::MainFrameDevToolsAgentImpl() { | 430 WebDevToolsAgentImpl* WebViewImpl::MainFrameDevToolsAgentImpl() { |
431 WebLocalFrameImpl* main_frame = MainFrameImpl(); | 431 WebLocalFrameImpl* main_frame = MainFrameImpl(); |
432 return main_frame ? main_frame->DevToolsAgentImpl() : nullptr; | 432 return main_frame ? main_frame->DevToolsAgentImpl() : nullptr; |
433 } | 433 } |
434 | 434 |
435 InspectorOverlay* WebViewImpl::GetInspectorOverlay() { | 435 InspectorOverlayAgent* WebViewImpl::GetInspectorOverlay() { |
436 if (WebDevToolsAgentImpl* devtools = MainFrameDevToolsAgentImpl()) | 436 if (WebDevToolsAgentImpl* devtools = MainFrameDevToolsAgentImpl()) |
437 return devtools->Overlay(); | 437 return devtools->OverlayAgent(); |
438 return nullptr; | 438 return nullptr; |
439 } | 439 } |
440 | 440 |
441 WebLocalFrameImpl* WebViewImpl::MainFrameImpl() const { | 441 WebLocalFrameImpl* WebViewImpl::MainFrameImpl() const { |
442 return page_ && page_->MainFrame() && page_->MainFrame()->IsLocalFrame() | 442 return page_ && page_->MainFrame() && page_->MainFrame()->IsLocalFrame() |
443 ? WebLocalFrameImpl::FromFrame(page_->DeprecatedLocalMainFrame()) | 443 ? WebLocalFrameImpl::FromFrame(page_->DeprecatedLocalMainFrame()) |
444 : nullptr; | 444 : nullptr; |
445 } | 445 } |
446 | 446 |
447 bool WebViewImpl::TabKeyCyclesThroughElements() const { | 447 bool WebViewImpl::TabKeyCyclesThroughElements() const { |
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 if (!MainFrameImpl()) | 2019 if (!MainFrameImpl()) |
2020 return; | 2020 return; |
2021 | 2021 |
2022 DocumentLifecycle::AllowThrottlingScope throttling_scope( | 2022 DocumentLifecycle::AllowThrottlingScope throttling_scope( |
2023 MainFrameImpl()->GetFrame()->GetDocument()->Lifecycle()); | 2023 MainFrameImpl()->GetFrame()->GetDocument()->Lifecycle()); |
2024 UpdateLayerTreeBackgroundColor(); | 2024 UpdateLayerTreeBackgroundColor(); |
2025 | 2025 |
2026 PageWidgetDelegate::UpdateAllLifecyclePhases(*page_, | 2026 PageWidgetDelegate::UpdateAllLifecyclePhases(*page_, |
2027 *MainFrameImpl()->GetFrame()); | 2027 *MainFrameImpl()->GetFrame()); |
2028 | 2028 |
2029 if (InspectorOverlay* overlay = GetInspectorOverlay()) { | 2029 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) { |
2030 overlay->UpdateAllLifecyclePhases(); | 2030 overlay->UpdateAllLifecyclePhases(); |
2031 // TODO(chrishtr): integrate paint into the overlay's lifecycle. | 2031 // TODO(chrishtr): integrate paint into the overlay's lifecycle. |
2032 if (overlay->GetPageOverlay() && | 2032 if (overlay->GetPageOverlay() && |
2033 overlay->GetPageOverlay()->GetGraphicsLayer()) | 2033 overlay->GetPageOverlay()->GetGraphicsLayer()) |
2034 overlay->GetPageOverlay()->GetGraphicsLayer()->Paint(nullptr); | 2034 overlay->GetPageOverlay()->GetGraphicsLayer()->Paint(nullptr); |
2035 } | 2035 } |
2036 if (page_color_overlay_) | 2036 if (page_color_overlay_) |
2037 page_color_overlay_->GetGraphicsLayer()->Paint(nullptr); | 2037 page_color_overlay_->GetGraphicsLayer()->Paint(nullptr); |
2038 | 2038 |
2039 // TODO(chrishtr): link highlights don't currently paint themselves, it's | 2039 // TODO(chrishtr): link highlights don't currently paint themselves, it's |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2162 TRACE_EVENT1("input,rail", "WebViewImpl::handleInputEvent", "type", | 2162 TRACE_EVENT1("input,rail", "WebViewImpl::handleInputEvent", "type", |
2163 WebInputEvent::GetName(input_event.GetType())); | 2163 WebInputEvent::GetName(input_event.GetType())); |
2164 | 2164 |
2165 // If a drag-and-drop operation is in progress, ignore input events. | 2165 // If a drag-and-drop operation is in progress, ignore input events. |
2166 if (MainFrameImpl()->FrameWidget()->DoingDragAndDrop()) | 2166 if (MainFrameImpl()->FrameWidget()->DoingDragAndDrop()) |
2167 return WebInputEventResult::kHandledSuppressed; | 2167 return WebInputEventResult::kHandledSuppressed; |
2168 | 2168 |
2169 if (dev_tools_emulator_->HandleInputEvent(input_event)) | 2169 if (dev_tools_emulator_->HandleInputEvent(input_event)) |
2170 return WebInputEventResult::kHandledSuppressed; | 2170 return WebInputEventResult::kHandledSuppressed; |
2171 | 2171 |
2172 if (InspectorOverlay* overlay = GetInspectorOverlay()) { | 2172 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) { |
2173 if (overlay->HandleInputEvent(input_event)) | 2173 if (overlay->HandleInputEvent(input_event)) |
2174 return WebInputEventResult::kHandledSuppressed; | 2174 return WebInputEventResult::kHandledSuppressed; |
2175 } | 2175 } |
2176 | 2176 |
2177 // Report the event to be NOT processed by WebKit, so that the browser can | 2177 // Report the event to be NOT processed by WebKit, so that the browser can |
2178 // handle it appropriately. | 2178 // handle it appropriately. |
2179 if (WebFrameWidgetBase::IgnoreInputEvents()) | 2179 if (WebFrameWidgetBase::IgnoreInputEvents()) |
2180 return WebInputEventResult::kNotHandled; | 2180 return WebInputEventResult::kNotHandled; |
2181 | 2181 |
2182 AutoReset<const WebInputEvent*> current_event_change(¤t_input_event_, | 2182 AutoReset<const WebInputEvent*> current_event_change(¤t_input_event_, |
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4125 return new CompositorWorkerProxyClientImpl(&Mutator()); | 4125 return new CompositorWorkerProxyClientImpl(&Mutator()); |
4126 } | 4126 } |
4127 | 4127 |
4128 AnimationWorkletProxyClient* WebViewImpl::CreateAnimationWorkletProxyClient() { | 4128 AnimationWorkletProxyClient* WebViewImpl::CreateAnimationWorkletProxyClient() { |
4129 return new AnimationWorkletProxyClientImpl(&Mutator()); | 4129 return new AnimationWorkletProxyClientImpl(&Mutator()); |
4130 } | 4130 } |
4131 | 4131 |
4132 void WebViewImpl::UpdatePageOverlays() { | 4132 void WebViewImpl::UpdatePageOverlays() { |
4133 if (page_color_overlay_) | 4133 if (page_color_overlay_) |
4134 page_color_overlay_->Update(); | 4134 page_color_overlay_->Update(); |
4135 if (InspectorOverlay* overlay = GetInspectorOverlay()) { | 4135 if (InspectorOverlayAgent* overlay = GetInspectorOverlay()) { |
4136 PageOverlay* inspector_page_overlay = overlay->GetPageOverlay(); | 4136 PageOverlay* inspector_page_overlay = overlay->GetPageOverlay(); |
4137 if (inspector_page_overlay) | 4137 if (inspector_page_overlay) |
4138 inspector_page_overlay->Update(); | 4138 inspector_page_overlay->Update(); |
4139 } | 4139 } |
4140 } | 4140 } |
4141 | 4141 |
4142 float WebViewImpl::DeviceScaleFactor() const { | 4142 float WebViewImpl::DeviceScaleFactor() const { |
4143 // TODO(oshima): Investigate if this should return the ScreenInfo's scale | 4143 // TODO(oshima): Investigate if this should return the ScreenInfo's scale |
4144 // factor rather than page's scale factor, which can be 1 in use-zoom-for-dsf | 4144 // factor rather than page's scale factor, which can be 1 in use-zoom-for-dsf |
4145 // mode. | 4145 // mode. |
(...skipping 11 matching lines...) Expand all Loading... |
4157 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4157 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
4158 return nullptr; | 4158 return nullptr; |
4159 return focused_frame; | 4159 return focused_frame; |
4160 } | 4160 } |
4161 | 4161 |
4162 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4162 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
4163 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4163 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
4164 } | 4164 } |
4165 | 4165 |
4166 } // namespace blink | 4166 } // namespace blink |
OLD | NEW |