Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Side by Side Diff: sky/engine/web/WebViewImpl.h

Issue 757143004: Remove m_layerTreeView from WebViewImpl. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/web/WebSettingsImpl.cpp ('k') | sky/engine/web/WebViewImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 virtual WebSize size() override; 75 virtual WebSize size() override;
76 virtual void willStartLiveResize() override; 76 virtual void willStartLiveResize() override;
77 virtual void resize(const WebSize&) override; 77 virtual void resize(const WebSize&) override;
78 virtual void willEndLiveResize() override; 78 virtual void willEndLiveResize() override;
79 79
80 virtual void beginFrame(const WebBeginFrameArgs&) override; 80 virtual void beginFrame(const WebBeginFrameArgs&) override;
81 virtual void didCommitFrameToCompositor() override; 81 virtual void didCommitFrameToCompositor() override;
82 82
83 virtual void layout() override; 83 virtual void layout() override;
84 virtual void paint(WebCanvas*, const WebRect&) override; 84 virtual void paint(WebCanvas*, const WebRect&) override;
85 #if OS(ANDROID)
86 virtual void paintCompositedDeprecated(WebCanvas*, const WebRect&) override;
87 #endif
88 virtual void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback* ) override;
89 virtual bool isTrackingRepaints() const override; 85 virtual bool isTrackingRepaints() const override;
90 virtual void themeChanged() override; 86 virtual void themeChanged() override;
91 virtual bool handleInputEvent(const WebInputEvent&) override; 87 virtual bool handleInputEvent(const WebInputEvent&) override;
92 virtual void setCursorVisibilityState(bool isVisible) override; 88 virtual void setCursorVisibilityState(bool isVisible) override;
93 virtual void mouseCaptureLost() override; 89 virtual void mouseCaptureLost() override;
94 virtual void setFocus(bool enable) override; 90 virtual void setFocus(bool enable) override;
95 virtual bool setComposition( 91 virtual bool setComposition(
96 const WebString& text, 92 const WebString& text,
97 const WebVector<WebCompositionUnderline>& underlines, 93 const WebVector<WebCompositionUnderline>& underlines,
98 int selectionStart, 94 int selectionStart,
99 int selectionEnd) override; 95 int selectionEnd) override;
100 virtual bool confirmComposition() override; 96 virtual bool confirmComposition() override;
101 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior ) override; 97 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior ) override;
102 virtual bool confirmComposition(const WebString& text) override; 98 virtual bool confirmComposition(const WebString& text) override;
103 virtual bool compositionRange(size_t* location, size_t* length) override; 99 virtual bool compositionRange(size_t* location, size_t* length) override;
104 virtual WebTextInputInfo textInputInfo() override; 100 virtual WebTextInputInfo textInputInfo() override;
105 virtual WebColor backgroundColor() const override; 101 virtual WebColor backgroundColor() const override;
106 virtual bool selectionBounds(WebRect& anchor, WebRect& focus) const override ; 102 virtual bool selectionBounds(WebRect& anchor, WebRect& focus) const override ;
107 virtual void didShowCandidateWindow() override; 103 virtual void didShowCandidateWindow() override;
108 virtual void didUpdateCandidateWindow() override; 104 virtual void didUpdateCandidateWindow() override;
109 virtual void didHideCandidateWindow() override; 105 virtual void didHideCandidateWindow() override;
110 virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirectio n& end) const override; 106 virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirectio n& end) const override;
111 virtual bool isSelectionAnchorFirst() const override; 107 virtual bool isSelectionAnchorFirst() const override;
112 virtual bool caretOrSelectionRange(size_t* location, size_t* length) overrid e; 108 virtual bool caretOrSelectionRange(size_t* location, size_t* length) overrid e;
113 virtual void setTextDirection(WebTextDirection) override; 109 virtual void setTextDirection(WebTextDirection) override;
114 virtual bool isAcceleratedCompositingActive() const override;
115 virtual void willCloseLayerTreeView() override;
116 110
117 // WebView methods: 111 // WebView methods:
118 virtual void setMainFrame(WebFrame*) override; 112 virtual void setMainFrame(WebFrame*) override;
119 virtual void injectModule(const WebString&) override; 113 virtual void injectModule(const WebString&) override;
120 virtual void setSpellCheckClient(WebSpellCheckClient*) override; 114 virtual void setSpellCheckClient(WebSpellCheckClient*) override;
121 virtual WebSettings* settings() override; 115 virtual WebSettings* settings() override;
122 virtual WebString pageEncoding() const override; 116 virtual WebString pageEncoding() const override;
123 virtual void setPageEncoding(const WebString&) override; 117 virtual void setPageEncoding(const WebString&) override;
124 virtual bool isTransparent() const override; 118 virtual bool isTransparent() const override;
125 virtual void setIsTransparent(bool value) override; 119 virtual void setIsTransparent(bool value) override;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // not take the user away from the current page. 229 // not take the user away from the current page.
236 void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage); 230 void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage);
237 231
238 // Indicates two things: 232 // Indicates two things:
239 // 1) This view may have a new layout now. 233 // 1) This view may have a new layout now.
240 // 2) Calling layout() is a no-op. 234 // 2) Calling layout() is a no-op.
241 // After calling WebWidget::layout(), expect to get this notification 235 // After calling WebWidget::layout(), expect to get this notification
242 // unless the view did not need a layout. 236 // unless the view did not need a layout.
243 void layoutUpdated(WebLocalFrameImpl*); 237 void layoutUpdated(WebLocalFrameImpl*);
244 238
245 void didRemoveAllPendingStylesheet(WebLocalFrameImpl*);
246
247 void updateMainFrameLayoutSize(); 239 void updateMainFrameLayoutSize();
248 240
249 // Returns the input event we're currently processing. This is used in some 241 // Returns the input event we're currently processing. This is used in some
250 // cases where the WebCore DOM event doesn't have the information we need. 242 // cases where the WebCore DOM event doesn't have the information we need.
251 static const WebInputEvent* currentInputEvent() 243 static const WebInputEvent* currentInputEvent()
252 { 244 {
253 return m_currentInputEvent; 245 return m_currentInputEvent;
254 } 246 }
255 247
256 GraphicsLayer* rootGraphicsLayer(); 248 GraphicsLayer* rootGraphicsLayer();
257 void setRootGraphicsLayer(GraphicsLayer*); 249 void setRootGraphicsLayer(GraphicsLayer*);
258 void scheduleCompositingLayerSync();
259 GraphicsLayerFactory* graphicsLayerFactory() const; 250 GraphicsLayerFactory* graphicsLayerFactory() const;
260 RenderLayerCompositor* compositor() const; 251 RenderLayerCompositor* compositor() const;
261 void registerForAnimations(WebLayer*);
262 void scheduleAnimation(); 252 void scheduleAnimation();
263 253
264 virtual void setVisibilityState(WebPageVisibilityState, bool) override; 254 virtual void setVisibilityState(WebPageVisibilityState, bool) override;
265 255
266 // Returns true if the event leads to scrolling. 256 // Returns true if the event leads to scrolling.
267 static bool mapKeyCodeForScroll( 257 static bool mapKeyCodeForScroll(
268 int keyCode, 258 int keyCode,
269 ScrollDirection*, 259 ScrollDirection*,
270 ScrollGranularity*); 260 ScrollGranularity*);
271 261
272 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale , WebPoint& scroll); 262 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale , WebPoint& scroll);
273 Node* bestTapNode(const PlatformGestureEvent& tapEvent); 263 Node* bestTapNode(const PlatformGestureEvent& tapEvent);
274 void enableTapHighlightAtPoint(const PlatformGestureEvent& tapEvent); 264 void enableTapHighlightAtPoint(const PlatformGestureEvent& tapEvent);
275 void enableTapHighlights(Vector<RawPtr<Node> >&); 265 void enableTapHighlights(Vector<RawPtr<Node> >&);
276 void computeScaleAndScrollForFocusedNode(Node* focusedNode, float& scale, In tPoint& scroll, bool& needAnimation); 266 void computeScaleAndScrollForFocusedNode(Node* focusedNode, float& scale, In tPoint& scroll, bool& needAnimation);
277 267
278 void clearCompositedSelectionBounds();
279
280 // Exposed for the purpose of overriding device metrics. 268 // Exposed for the purpose of overriding device metrics.
281 void sendResizeEventAndRepaint(); 269 void sendResizeEventAndRepaint();
282 270
283 // Exposed for testing purposes. 271 // Exposed for testing purposes.
284 bool hasHorizontalScrollbar(); 272 bool hasHorizontalScrollbar();
285 bool hasVerticalScrollbar(); 273 bool hasVerticalScrollbar();
286 274
287 // Heuristic-based function for determining if we should disable workarounds 275 // Heuristic-based function for determining if we should disable workarounds
288 // for viewing websites that are not optimized for mobile devices. 276 // for viewing websites that are not optimized for mobile devices.
289 bool shouldDisableDesktopWorkarounds(); 277 bool shouldDisableDesktopWorkarounds();
290 278
291 // Exposed for tests. 279 // Exposed for tests.
292 unsigned numLinkHighlights() { return m_linkHighlights.size(); } 280 unsigned numLinkHighlights() { return m_linkHighlights.size(); }
293 LinkHighlight* linkHighlight(int i) { return m_linkHighlights[i].get(); } 281 LinkHighlight* linkHighlight(int i) { return m_linkHighlights[i].get(); }
294 282
295 WebSettingsImpl* settingsImpl(); 283 WebSettingsImpl* settingsImpl();
296 284
297 // Returns the bounding box of the block type node touched by the WebRect. 285 // Returns the bounding box of the block type node touched by the WebRect.
298 WebRect computeBlockBounds(const WebRect&, bool ignoreClipping); 286 WebRect computeBlockBounds(const WebRect&, bool ignoreClipping);
299 287
300 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale); 288 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale);
301 289
302 // Exposed for tests. 290 // Exposed for tests.
303 WebVector<WebCompositionUnderline> compositionUnderlines() const; 291 WebVector<WebCompositionUnderline> compositionUnderlines() const;
304 292
305 bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_match esHeuristicsForGpuRasterization; } 293 bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_match esHeuristicsForGpuRasterization; }
306 294
307 private: 295 private:
308 void resumeTreeViewCommits();
309 IntSize contentsSize() const; 296 IntSize contentsSize() const;
310 297
311 void resetSavedScrollAndScaleState(); 298 void resetSavedScrollAndScaleState();
312 299
313 void updateMainFrameScrollPosition(const IntPoint& scrollPosition, bool prog rammaticScroll); 300 void updateMainFrameScrollPosition(const IntPoint& scrollPosition, bool prog rammaticScroll);
314 301
315 void performResize(); 302 void performResize();
316 303
317 friend class WebView; // So WebView::Create can call our constructor 304 friend class WebView; // So WebView::Create can call our constructor
318 friend class WTF::RefCounted<WebViewImpl>; 305 friend class WTF::RefCounted<WebViewImpl>;
(...skipping 17 matching lines...) Expand all
336 323
337 bool confirmComposition(const WebString& text, ConfirmCompositionBehavior); 324 bool confirmComposition(const WebString& text, ConfirmCompositionBehavior);
338 325
339 // Returns true if the view was scrolled. 326 // Returns true if the view was scrolled.
340 bool scrollViewWithKeyboard(int keyCode, int modifiers); 327 bool scrollViewWithKeyboard(int keyCode, int modifiers);
341 328
342 // Converts |pos| from window coordinates to contents coordinates and gets 329 // Converts |pos| from window coordinates to contents coordinates and gets
343 // the HitTestResult for it. 330 // the HitTestResult for it.
344 HitTestResult hitTestResultForWindowPos(const IntPoint&); 331 HitTestResult hitTestResultForWindowPos(const IntPoint&);
345 332
346 void setIsAcceleratedCompositingActive(bool);
347 void doComposite(); 333 void doComposite();
348 void reallocateRenderer(); 334 void reallocateRenderer();
349 void updateLayerTreeBackgroundColor();
350 void updateRootLayerTransform(); 335 void updateRootLayerTransform();
351 void updateLayerTreeDeviceScaleFactor();
352 336
353 // Helper function: Widens the width of |source| by the specified margins 337 // Helper function: Widens the width of |source| by the specified margins
354 // while keeping it smaller than page width. 338 // while keeping it smaller than page width.
355 WebRect widenRectWithinPageBounds(const WebRect& source, int targetMargin, i nt minimumMargin); 339 WebRect widenRectWithinPageBounds(const WebRect& source, int targetMargin, i nt minimumMargin);
356 340
357 // PageWidgetEventHandler functions 341 // PageWidgetEventHandler functions
358 virtual void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override; 342 virtual void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override;
359 virtual void handleMouseDown(LocalFrame&, const WebMouseEvent&) override; 343 virtual void handleMouseDown(LocalFrame&, const WebMouseEvent&) override;
360 virtual void handleMouseUp(LocalFrame&, const WebMouseEvent&) override; 344 virtual void handleMouseUp(LocalFrame&, const WebMouseEvent&) override;
361 virtual bool handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) overri de; 345 virtual bool handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) overri de;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 bool m_isTransparent; 396 bool m_isTransparent;
413 397
414 // Whether the user can press tab to focus links. 398 // Whether the user can press tab to focus links.
415 bool m_tabsToLinks; 399 bool m_tabsToLinks;
416 400
417 // If set, the (plugin) node which has mouse capture. 401 // If set, the (plugin) node which has mouse capture.
418 RefPtr<Node> m_mouseCaptureNode; 402 RefPtr<Node> m_mouseCaptureNode;
419 RefPtr<UserGestureToken> m_mouseCaptureGestureToken; 403 RefPtr<UserGestureToken> m_mouseCaptureGestureToken;
420 404
421 IntRect m_rootLayerScrollDamage; 405 IntRect m_rootLayerScrollDamage;
422 WebLayerTreeView* m_layerTreeView;
423 WebLayer* m_rootLayer; 406 WebLayer* m_rootLayer;
424 GraphicsLayer* m_rootGraphicsLayer; 407 GraphicsLayer* m_rootGraphicsLayer;
425 GraphicsLayer* m_rootTransformLayer; 408 GraphicsLayer* m_rootTransformLayer;
426 OwnPtr<GraphicsLayerFactory> m_graphicsLayerFactory; 409 OwnPtr<GraphicsLayerFactory> m_graphicsLayerFactory;
427 bool m_isAcceleratedCompositingActive;
428 bool m_layerTreeViewCommitsDeferred;
429 bool m_layerTreeViewClosed;
430 bool m_matchesHeuristicsForGpuRasterization; 410 bool m_matchesHeuristicsForGpuRasterization;
431 // If true, the graphics context is being restored. 411 // If true, the graphics context is being restored.
432 bool m_recreatingGraphicsContext; 412 bool m_recreatingGraphicsContext;
433 static const WebInputEvent* m_currentInputEvent; 413 static const WebInputEvent* m_currentInputEvent;
434 414
435 OwnPtr<WebActiveGestureAnimation> m_gestureAnimation; 415 OwnPtr<WebActiveGestureAnimation> m_gestureAnimation;
436 WebPoint m_positionOnFlingStart; 416 WebPoint m_positionOnFlingStart;
437 WebPoint m_globalPositionOnFlingStart; 417 WebPoint m_globalPositionOnFlingStart;
438 int m_flingModifier; 418 int m_flingModifier;
439 bool m_flingSourceDevice; 419 bool m_flingSourceDevice;
(...skipping 10 matching lines...) Expand all
450 bool m_userGestureObserved; 430 bool m_userGestureObserved;
451 }; 431 };
452 432
453 // We have no ways to check if the specified WebView is an instance of 433 // We have no ways to check if the specified WebView is an instance of
454 // WebViewImpl because WebViewImpl is the only implementation of WebView. 434 // WebViewImpl because WebViewImpl is the only implementation of WebView.
455 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); 435 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);
456 436
457 } // namespace blink 437 } // namespace blink
458 438
459 #endif // SKY_ENGINE_WEB_WEBVIEWIMPL_H_ 439 #endif // SKY_ENGINE_WEB_WEBVIEWIMPL_H_
OLDNEW
« no previous file with comments | « sky/engine/web/WebSettingsImpl.cpp ('k') | sky/engine/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698