Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file.#ifndef WebViewBase_h | 3 // found in the LICENSE file.#ifndef WebViewBase_h |
| 4 | 4 |
| 5 #ifndef WebViewBase_h | 5 #ifndef WebViewBase_h |
| 6 #define WebViewBase_h | 6 #define WebViewBase_h |
| 7 | 7 |
| 8 #include "core/page/EventWithHitTestResults.h" | |
| 8 #include "platform/transforms/TransformationMatrix.h" | 9 #include "platform/transforms/TransformationMatrix.h" |
| 9 #include "platform/wtf/RefCounted.h" | 10 #include "platform/wtf/RefCounted.h" |
| 10 #include "public/platform/WebDisplayMode.h" | 11 #include "public/platform/WebDisplayMode.h" |
| 11 #include "public/platform/WebInputEventResult.h" | 12 #include "public/platform/WebInputEventResult.h" |
| 12 #include "public/web/WebElement.h" | 13 #include "public/web/WebElement.h" |
| 13 #include "public/web/WebView.h" | 14 #include "public/web/WebView.h" |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 class AnimationWorkletProxyClient; | 18 class AnimationWorkletProxyClient; |
| 19 class BrowserControls; | |
| 18 class ChromeClient; | 20 class ChromeClient; |
| 19 class CompositorAnimationHost; | 21 class CompositorAnimationHost; |
| 20 class CompositorWorkerProxyClient; | 22 class CompositorWorkerProxyClient; |
| 21 class CompositorAnimationTimeline; | 23 class CompositorAnimationTimeline; |
| 22 class ContextMenuProvider; | 24 class ContextMenuProvider; |
| 23 class DevToolsEmulator; | 25 class DevToolsEmulator; |
| 24 class Frame; | 26 class Frame; |
| 25 class GraphicsLayer; | 27 class GraphicsLayer; |
| 26 class HitTestResult; | 28 class HitTestResult; |
| 29 class LinkHighlightImpl; | |
| 27 class Page; | 30 class Page; |
| 28 class PaintLayerCompositor; | 31 class PaintLayerCompositor; |
| 29 class PagePopup; | 32 class PagePopup; |
| 30 class PagePopupClient; | 33 class PagePopupClient; |
| 31 class PageScaleConstraintsSet; | 34 class PageScaleConstraintsSet; |
| 32 class WebInputEvent; | 35 class WebInputEvent; |
| 33 class WebInputMethodControllerImpl; | 36 class WebInputMethodControllerImpl; |
| 34 class WebKeyboardEvent; | 37 class WebKeyboardEvent; |
| 35 class WebLayer; | 38 class WebLayer; |
| 36 class WebLocalFrameImpl; | 39 class WebLocalFrameImpl; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 56 virtual void SetBackgroundColorOverride(WebColor) = 0; | 59 virtual void SetBackgroundColorOverride(WebColor) = 0; |
| 57 virtual void ClearBackgroundColorOverride() = 0; | 60 virtual void ClearBackgroundColorOverride() = 0; |
| 58 virtual void SetZoomFactorOverride(float) = 0; | 61 virtual void SetZoomFactorOverride(float) = 0; |
| 59 virtual void SetCompositorDeviceScaleFactorOverride(float) = 0; | 62 virtual void SetCompositorDeviceScaleFactorOverride(float) = 0; |
| 60 virtual void SetDeviceEmulationTransform(const TransformationMatrix&) = 0; | 63 virtual void SetDeviceEmulationTransform(const TransformationMatrix&) = 0; |
| 61 virtual void SetShowDebugBorders(bool) = 0; | 64 virtual void SetShowDebugBorders(bool) = 0; |
| 62 | 65 |
| 63 virtual Page* GetPage() const = 0; | 66 virtual Page* GetPage() const = 0; |
| 64 virtual Frame* FocusedCoreFrame() const = 0; | 67 virtual Frame* FocusedCoreFrame() const = 0; |
| 65 | 68 |
| 69 PLATFORM_EXPORT static WebViewBase* Create(WebViewClient*, | |
|
sashab
2017/05/03 04:05:22
I think BLINK_EXPORT is better than PLATFORM_EXPOR
slangley
2017/05/03 21:43:08
I think because of the layering, PLATFORM_EXPORT m
haraken
2017/05/04 05:30:42
This file is in core/, not platform/. Why can't we
slangley
2017/05/04 09:15:34
CORE_EXPORT has an additional compiler defined con
haraken
2017/05/04 15:14:31
Hmm. Maybe I'm a bit behind.
No one in core/ is u
| |
| 70 WebPageVisibilityState); | |
| 71 | |
| 66 static WebViewBase* FromPage(Page*); | 72 static WebViewBase* FromPage(Page*); |
| 67 static HashSet<WebViewBase*>& AllInstances(); | 73 static HashSet<WebViewBase*>& AllInstances(); |
| 68 | 74 |
| 69 // Returns the main frame associated with this view. This may be null when | 75 // Returns the main frame associated with this view. This may be null when |
| 70 // the page is shutting down, but will be valid at all other times. | 76 // the page is shutting down, but will be valid at all other times. |
| 71 virtual WebLocalFrameImpl* MainFrameImpl() const = 0; | 77 virtual WebLocalFrameImpl* MainFrameImpl() const = 0; |
| 72 | 78 |
| 73 virtual float DefaultMinimumPageScaleFactor() const = 0; | 79 virtual float DefaultMinimumPageScaleFactor() const = 0; |
| 74 virtual float DefaultMaximumPageScaleFactor() const = 0; | 80 virtual float DefaultMaximumPageScaleFactor() const = 0; |
| 75 virtual float MinimumPageScaleFactor() const = 0; | 81 virtual float MinimumPageScaleFactor() const = 0; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 const = 0; | 178 const = 0; |
| 173 virtual void ScheduleAnimationForWidget() = 0; | 179 virtual void ScheduleAnimationForWidget() = 0; |
| 174 virtual CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient() = 0; | 180 virtual CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient() = 0; |
| 175 virtual AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient() = 0; | 181 virtual AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient() = 0; |
| 176 virtual void SetRootGraphicsLayer(GraphicsLayer*) = 0; | 182 virtual void SetRootGraphicsLayer(GraphicsLayer*) = 0; |
| 177 virtual void SetRootLayer(WebLayer*) = 0; | 183 virtual void SetRootLayer(WebLayer*) = 0; |
| 178 virtual CompositorAnimationHost* AnimationHost() const = 0; | 184 virtual CompositorAnimationHost* AnimationHost() const = 0; |
| 179 virtual HitTestResult CoreHitTestResultAt(const WebPoint&) = 0; | 185 virtual HitTestResult CoreHitTestResultAt(const WebPoint&) = 0; |
| 180 | 186 |
| 181 virtual class ChromeClient& ChromeClient() const = 0; | 187 virtual class ChromeClient& ChromeClient() const = 0; |
| 188 | |
| 189 // These methods are consumed by test code only. | |
| 190 virtual BrowserControls& GetBrowserControls() = 0; | |
|
sashab
2017/05/03 04:05:22
Make them private? And add the test as a friend cl
slangley
2017/05/03 21:43:08
In general for these changes my idea is:
a) Move
| |
| 191 virtual Element* FocusedElement() const = 0; | |
| 192 virtual void EnableFakePageScaleAnimationForTesting(bool) = 0; | |
| 193 virtual bool FakeDoubleTapAnimationPendingForTesting() const = 0; | |
| 194 virtual void AnimateDoubleTapZoom(const IntPoint&) = 0; | |
| 195 virtual WebRect ComputeBlockBound(const WebPoint&, bool ignore_clipping) = 0; | |
| 196 virtual void ComputeScaleAndScrollForBlockRect( | |
| 197 const WebPoint& hit_point, | |
| 198 const WebRect& block_rect, | |
| 199 float padding, | |
| 200 float default_scale_when_already_legible, | |
| 201 float& scale, | |
| 202 WebPoint& scroll) = 0; | |
| 203 virtual float FakePageScaleAnimationPageScaleForTesting() const = 0; | |
| 204 virtual bool FakePageScaleAnimationUseAnchorForTesting() const = 0; | |
| 205 virtual IntPoint FakePageScaleAnimationTargetPositionForTesting() const = 0; | |
| 206 virtual void ComputeScaleAndScrollForFocusedNode( | |
| 207 Node* focused_node, | |
| 208 bool zoom_in_to_legible_scale, | |
| 209 float& scale, | |
| 210 IntPoint& scroll, | |
| 211 bool& need_animation) = 0; | |
| 212 virtual bool HasHorizontalScrollbar() = 0; | |
| 213 virtual bool HasVerticalScrollbar() = 0; | |
| 214 virtual TransformationMatrix GetDeviceEmulationTransformForTesting() | |
| 215 const = 0; | |
| 216 virtual bool MatchesHeuristicsForGpuRasterizationForTesting() const = 0; | |
| 217 virtual Node* BestTapNode( | |
| 218 const GestureEventWithHitTestResults& targeted_tap_event) = 0; | |
| 219 virtual void EnableTapHighlightAtPoint( | |
| 220 const GestureEventWithHitTestResults& targeted_tap_event) = 0; | |
| 221 virtual LinkHighlightImpl* GetLinkHighlight(int) = 0; | |
| 222 virtual unsigned NumLinkHighlights() = 0; | |
| 223 virtual void EnableTapHighlights(HeapVector<Member<Node>>&) = 0; | |
| 224 PLATFORM_EXPORT static void SetCurrentInputEventForTest(const WebInputEvent*); | |
|
haraken
2017/05/04 05:30:42
Ditto.
| |
| 182 }; | 225 }; |
| 183 } | 226 } |
| 184 | 227 |
| 185 #endif | 228 #endif |
| OLD | NEW |