| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "web/MediaKeysClientImpl.h" | 53 #include "web/MediaKeysClientImpl.h" |
| 54 #include "web/PageOverlayList.h" | 54 #include "web/PageOverlayList.h" |
| 55 #include "web/PageScaleConstraintsSet.h" | 55 #include "web/PageScaleConstraintsSet.h" |
| 56 #include "web/PageWidgetDelegate.h" | 56 #include "web/PageWidgetDelegate.h" |
| 57 #include "web/SpellCheckerClientImpl.h" | 57 #include "web/SpellCheckerClientImpl.h" |
| 58 #include "web/StorageClientImpl.h" | 58 #include "web/StorageClientImpl.h" |
| 59 #include "wtf/OwnPtr.h" | 59 #include "wtf/OwnPtr.h" |
| 60 #include "wtf/RefCounted.h" | 60 #include "wtf/RefCounted.h" |
| 61 #include "wtf/Vector.h" | 61 #include "wtf/Vector.h" |
| 62 | 62 |
| 63 namespace WebCore { | 63 namespace blink { |
| 64 class DataObject; | 64 class DataObject; |
| 65 class Frame; | 65 class Frame; |
| 66 class RenderLayerCompositor; | 66 class RenderLayerCompositor; |
| 67 class UserGestureToken; | 67 class UserGestureToken; |
| 68 } | 68 } |
| 69 | 69 |
| 70 namespace blink { | 70 namespace blink { |
| 71 class LinkHighlight; | 71 class LinkHighlight; |
| 72 class PopupContainer; | 72 class PopupContainer; |
| 73 class WebActiveGestureAnimation; | 73 class WebActiveGestureAnimation; |
| 74 class WebDevToolsAgentPrivate; | 74 class WebDevToolsAgentPrivate; |
| 75 class WebLocalFrameImpl; | 75 class WebLocalFrameImpl; |
| 76 class WebImage; | 76 class WebImage; |
| 77 class WebPagePopupImpl; | 77 class WebPagePopupImpl; |
| 78 class WebPlugin; | 78 class WebPlugin; |
| 79 class WebSettingsImpl; | 79 class WebSettingsImpl; |
| 80 class FullscreenController; | 80 class FullscreenController; |
| 81 | 81 |
| 82 class WebViewImpl FINAL : public WebView | 82 class WebViewImpl FINAL : public WebView |
| 83 , public RefCounted<WebViewImpl> | 83 , public RefCounted<WebViewImpl> |
| 84 , public WebGestureCurveTarget | 84 , public WebGestureCurveTarget |
| 85 , public WebCore::PagePopupDriver | 85 , public blink::PagePopupDriver |
| 86 , public PageWidgetEventHandler { | 86 , public PageWidgetEventHandler { |
| 87 public: | 87 public: |
| 88 static WebViewImpl* create(WebViewClient*); | 88 static WebViewImpl* create(WebViewClient*); |
| 89 | 89 |
| 90 // WebWidget methods: | 90 // WebWidget methods: |
| 91 virtual void close() OVERRIDE; | 91 virtual void close() OVERRIDE; |
| 92 virtual WebSize size() OVERRIDE; | 92 virtual WebSize size() OVERRIDE; |
| 93 virtual void willStartLiveResize() OVERRIDE; | 93 virtual void willStartLiveResize() OVERRIDE; |
| 94 virtual void resize(const WebSize&) OVERRIDE; | 94 virtual void resize(const WebSize&) OVERRIDE; |
| 95 virtual void resizePinchViewport(const WebSize&) OVERRIDE; | 95 virtual void resizePinchViewport(const WebSize&) OVERRIDE; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 virtual void setShowPaintRects(bool) OVERRIDE; | 255 virtual void setShowPaintRects(bool) OVERRIDE; |
| 256 void setShowDebugBorders(bool); | 256 void setShowDebugBorders(bool); |
| 257 virtual void setShowFPSCounter(bool) OVERRIDE; | 257 virtual void setShowFPSCounter(bool) OVERRIDE; |
| 258 virtual void setContinuousPaintingEnabled(bool) OVERRIDE; | 258 virtual void setContinuousPaintingEnabled(bool) OVERRIDE; |
| 259 virtual void setShowScrollBottleneckRects(bool) OVERRIDE; | 259 virtual void setShowScrollBottleneckRects(bool) OVERRIDE; |
| 260 virtual void getSelectionRootBounds(WebRect& bounds) const OVERRIDE; | 260 virtual void getSelectionRootBounds(WebRect& bounds) const OVERRIDE; |
| 261 virtual void acceptLanguagesChanged() OVERRIDE; | 261 virtual void acceptLanguagesChanged() OVERRIDE; |
| 262 | 262 |
| 263 // WebViewImpl | 263 // WebViewImpl |
| 264 | 264 |
| 265 WebCore::HitTestResult coreHitTestResultAt(const WebPoint&); | 265 blink::HitTestResult coreHitTestResultAt(const WebPoint&); |
| 266 void suppressInvalidations(bool enable); | 266 void suppressInvalidations(bool enable); |
| 267 void invalidateRect(const WebCore::IntRect&); | 267 void invalidateRect(const blink::IntRect&); |
| 268 | 268 |
| 269 void setIgnoreInputEvents(bool newValue); | 269 void setIgnoreInputEvents(bool newValue); |
| 270 void setBackgroundColorOverride(WebColor); | 270 void setBackgroundColorOverride(WebColor); |
| 271 void setZoomFactorOverride(float); | 271 void setZoomFactorOverride(float); |
| 272 WebDevToolsAgentPrivate* devToolsAgentPrivate() { return m_devToolsAgent.get
(); } | 272 WebDevToolsAgentPrivate* devToolsAgentPrivate() { return m_devToolsAgent.get
(); } |
| 273 | 273 |
| 274 WebCore::Color baseBackgroundColor() const { return m_baseBackgroundColor; } | 274 blink::Color baseBackgroundColor() const { return m_baseBackgroundColor; } |
| 275 | 275 |
| 276 PageOverlayList* pageOverlays() const { return m_pageOverlays.get(); } | 276 PageOverlayList* pageOverlays() const { return m_pageOverlays.get(); } |
| 277 | 277 |
| 278 void setOverlayLayer(WebCore::GraphicsLayer*); | 278 void setOverlayLayer(blink::GraphicsLayer*); |
| 279 | 279 |
| 280 const WebPoint& lastMouseDownPoint() const | 280 const WebPoint& lastMouseDownPoint() const |
| 281 { | 281 { |
| 282 return m_lastMouseDownPoint; | 282 return m_lastMouseDownPoint; |
| 283 } | 283 } |
| 284 | 284 |
| 285 WebCore::Frame* focusedWebCoreFrame() const; | 285 blink::Frame* focusedWebCoreFrame() const; |
| 286 | 286 |
| 287 // Returns the currently focused Element or null if no element has focus. | 287 // Returns the currently focused Element or null if no element has focus. |
| 288 WebCore::Element* focusedElement() const; | 288 blink::Element* focusedElement() const; |
| 289 | 289 |
| 290 static WebViewImpl* fromPage(WebCore::Page*); | 290 static WebViewImpl* fromPage(blink::Page*); |
| 291 | 291 |
| 292 WebViewClient* client() | 292 WebViewClient* client() |
| 293 { | 293 { |
| 294 return m_client; | 294 return m_client; |
| 295 } | 295 } |
| 296 | 296 |
| 297 WebAutofillClient* autofillClient() | 297 WebAutofillClient* autofillClient() |
| 298 { | 298 { |
| 299 return m_autofillClient; | 299 return m_autofillClient; |
| 300 } | 300 } |
| 301 | 301 |
| 302 WebSpellCheckClient* spellCheckClient() | 302 WebSpellCheckClient* spellCheckClient() |
| 303 { | 303 { |
| 304 return m_spellCheckClient; | 304 return m_spellCheckClient; |
| 305 } | 305 } |
| 306 | 306 |
| 307 // Returns the page object associated with this view. This may be null when | 307 // Returns the page object associated with this view. This may be null when |
| 308 // the page is shutting down, but will be valid at all other times. | 308 // the page is shutting down, but will be valid at all other times. |
| 309 WebCore::Page* page() const | 309 blink::Page* page() const |
| 310 { | 310 { |
| 311 return m_page.get(); | 311 return m_page.get(); |
| 312 } | 312 } |
| 313 | 313 |
| 314 // Returns the main frame associated with this view. This may be null when | 314 // Returns the main frame associated with this view. This may be null when |
| 315 // the page is shutting down, but will be valid at all other times. | 315 // the page is shutting down, but will be valid at all other times. |
| 316 WebLocalFrameImpl* mainFrameImpl(); | 316 WebLocalFrameImpl* mainFrameImpl(); |
| 317 | 317 |
| 318 // FIXME: Temporary method to accommodate out-of-process frame ancestors; | 318 // FIXME: Temporary method to accommodate out-of-process frame ancestors; |
| 319 // will be removed when there can be multiple WebWidgets for a single page. | 319 // will be removed when there can be multiple WebWidgets for a single page. |
| 320 WebLocalFrameImpl* localFrameRootTemporary() const; | 320 WebLocalFrameImpl* localFrameRootTemporary() const; |
| 321 | 321 |
| 322 // Event related methods: | 322 // Event related methods: |
| 323 void mouseContextMenu(const WebMouseEvent&); | 323 void mouseContextMenu(const WebMouseEvent&); |
| 324 void mouseDoubleClick(const WebMouseEvent&); | 324 void mouseDoubleClick(const WebMouseEvent&); |
| 325 | 325 |
| 326 bool detectContentOnTouch(const WebPoint&); | 326 bool detectContentOnTouch(const WebPoint&); |
| 327 bool startPageScaleAnimation(const WebCore::IntPoint& targetPosition, bool u
seAnchor, float newScale, double durationInSeconds); | 327 bool startPageScaleAnimation(const blink::IntPoint& targetPosition, bool use
Anchor, float newScale, double durationInSeconds); |
| 328 | 328 |
| 329 void hasTouchEventHandlers(bool); | 329 void hasTouchEventHandlers(bool); |
| 330 | 330 |
| 331 // WebGestureCurveTarget implementation for fling. | 331 // WebGestureCurveTarget implementation for fling. |
| 332 virtual bool scrollBy(const WebFloatSize& delta, const WebFloatSize& velocit
y) OVERRIDE; | 332 virtual bool scrollBy(const WebFloatSize& delta, const WebFloatSize& velocit
y) OVERRIDE; |
| 333 | 333 |
| 334 // Handles context menu events orignated via the the keyboard. These | 334 // Handles context menu events orignated via the the keyboard. These |
| 335 // include the VK_APPS virtual key and the Shift+F10 combine. Code is | 335 // include the VK_APPS virtual key and the Shift+F10 combine. Code is |
| 336 // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM | 336 // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM |
| 337 // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only | 337 // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only |
| 338 // significant change in this function is the code to convert from a | 338 // significant change in this function is the code to convert from a |
| 339 // Keyboard event to the Right Mouse button down event. | 339 // Keyboard event to the Right Mouse button down event. |
| 340 bool sendContextMenuEvent(const WebKeyboardEvent&); | 340 bool sendContextMenuEvent(const WebKeyboardEvent&); |
| 341 | 341 |
| 342 void showContextMenuAtPoint(float x, float y, PassRefPtr<WebCore::ContextMen
uProvider>); | 342 void showContextMenuAtPoint(float x, float y, PassRefPtr<blink::ContextMenuP
rovider>); |
| 343 | 343 |
| 344 // Notifies the WebView that a load has been committed. isNewNavigation | 344 // Notifies the WebView that a load has been committed. isNewNavigation |
| 345 // will be true if a new session history item should be created for that | 345 // will be true if a new session history item should be created for that |
| 346 // load. isNavigationWithinPage will be true if the navigation does | 346 // load. isNavigationWithinPage will be true if the navigation does |
| 347 // not take the user away from the current page. | 347 // not take the user away from the current page. |
| 348 void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage); | 348 void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage); |
| 349 | 349 |
| 350 // Indicates two things: | 350 // Indicates two things: |
| 351 // 1) This view may have a new layout now. | 351 // 1) This view may have a new layout now. |
| 352 // 2) Calling layout() is a no-op. | 352 // 2) Calling layout() is a no-op. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 365 bool contextMenuAllowed() const | 365 bool contextMenuAllowed() const |
| 366 { | 366 { |
| 367 return m_contextMenuAllowed; | 367 return m_contextMenuAllowed; |
| 368 } | 368 } |
| 369 | 369 |
| 370 bool shouldAutoResize() const | 370 bool shouldAutoResize() const |
| 371 { | 371 { |
| 372 return m_shouldAutoResize; | 372 return m_shouldAutoResize; |
| 373 } | 373 } |
| 374 | 374 |
| 375 WebCore::IntSize minAutoSize() const | 375 blink::IntSize minAutoSize() const |
| 376 { | 376 { |
| 377 return m_minAutoSize; | 377 return m_minAutoSize; |
| 378 } | 378 } |
| 379 | 379 |
| 380 WebCore::IntSize maxAutoSize() const | 380 blink::IntSize maxAutoSize() const |
| 381 { | 381 { |
| 382 return m_maxAutoSize; | 382 return m_maxAutoSize; |
| 383 } | 383 } |
| 384 | 384 |
| 385 void updateMainFrameLayoutSize(); | 385 void updateMainFrameLayoutSize(); |
| 386 void updatePageDefinedViewportConstraints(const WebCore::ViewportDescription
&); | 386 void updatePageDefinedViewportConstraints(const blink::ViewportDescription&)
; |
| 387 | 387 |
| 388 // Start a system drag and drop operation. | 388 // Start a system drag and drop operation. |
| 389 void startDragging( | 389 void startDragging( |
| 390 WebCore::LocalFrame*, | 390 blink::LocalFrame*, |
| 391 const WebDragData& dragData, | 391 const WebDragData& dragData, |
| 392 WebDragOperationsMask mask, | 392 WebDragOperationsMask mask, |
| 393 const WebImage& dragImage, | 393 const WebImage& dragImage, |
| 394 const WebPoint& dragImageOffset); | 394 const WebPoint& dragImageOffset); |
| 395 | 395 |
| 396 // Notification that a popup was opened/closed. | 396 // Notification that a popup was opened/closed. |
| 397 void popupOpened(PopupContainer*); | 397 void popupOpened(PopupContainer*); |
| 398 void popupClosed(PopupContainer*); | 398 void popupClosed(PopupContainer*); |
| 399 // PagePopupDriver functions. | 399 // PagePopupDriver functions. |
| 400 virtual WebCore::PagePopup* openPagePopup(WebCore::PagePopupClient*, const W
ebCore::IntRect& originBoundsInRootView) OVERRIDE; | 400 virtual blink::PagePopup* openPagePopup(blink::PagePopupClient*, const blink
::IntRect& originBoundsInRootView) OVERRIDE; |
| 401 virtual void closePagePopup(WebCore::PagePopup*) OVERRIDE; | 401 virtual void closePagePopup(blink::PagePopup*) OVERRIDE; |
| 402 | 402 |
| 403 // Returns the input event we're currently processing. This is used in some | 403 // Returns the input event we're currently processing. This is used in some |
| 404 // cases where the WebCore DOM event doesn't have the information we need. | 404 // cases where the WebCore DOM event doesn't have the information we need. |
| 405 static const WebInputEvent* currentInputEvent() | 405 static const WebInputEvent* currentInputEvent() |
| 406 { | 406 { |
| 407 return m_currentInputEvent; | 407 return m_currentInputEvent; |
| 408 } | 408 } |
| 409 | 409 |
| 410 WebCore::GraphicsLayer* rootGraphicsLayer(); | 410 blink::GraphicsLayer* rootGraphicsLayer(); |
| 411 void setRootGraphicsLayer(WebCore::GraphicsLayer*); | 411 void setRootGraphicsLayer(blink::GraphicsLayer*); |
| 412 void scheduleCompositingLayerSync(); | 412 void scheduleCompositingLayerSync(); |
| 413 void scrollRootLayer(); | 413 void scrollRootLayer(); |
| 414 WebCore::GraphicsLayerFactory* graphicsLayerFactory() const; | 414 blink::GraphicsLayerFactory* graphicsLayerFactory() const; |
| 415 WebCore::RenderLayerCompositor* compositor() const; | 415 blink::RenderLayerCompositor* compositor() const; |
| 416 void registerForAnimations(WebLayer*); | 416 void registerForAnimations(WebLayer*); |
| 417 void scheduleAnimation(); | 417 void scheduleAnimation(); |
| 418 | 418 |
| 419 virtual void setVisibilityState(WebPageVisibilityState, bool) OVERRIDE; | 419 virtual void setVisibilityState(WebPageVisibilityState, bool) OVERRIDE; |
| 420 | 420 |
| 421 PopupContainer* selectPopup() const { return m_selectPopup.get(); } | 421 PopupContainer* selectPopup() const { return m_selectPopup.get(); } |
| 422 bool hasOpenedPopup() const { return m_selectPopup || m_pagePopup; } | 422 bool hasOpenedPopup() const { return m_selectPopup || m_pagePopup; } |
| 423 | 423 |
| 424 // Returns true if the event leads to scrolling. | 424 // Returns true if the event leads to scrolling. |
| 425 static bool mapKeyCodeForScroll(int keyCode, | 425 static bool mapKeyCodeForScroll(int keyCode, |
| 426 WebCore::ScrollDirection* scrollDirection, | 426 blink::ScrollDirection* scrollDirection, |
| 427 WebCore::ScrollGranularity* scrollGranularity
); | 427 blink::ScrollGranularity* scrollGranularity); |
| 428 | 428 |
| 429 // Called by a full frame plugin inside this view to inform it that its | 429 // Called by a full frame plugin inside this view to inform it that its |
| 430 // zoom level has been updated. The plugin should only call this function | 430 // zoom level has been updated. The plugin should only call this function |
| 431 // if the zoom change was triggered by the browser, it's only needed in case | 431 // if the zoom change was triggered by the browser, it's only needed in case |
| 432 // a plugin can update its own zoom, say because of its own UI. | 432 // a plugin can update its own zoom, say because of its own UI. |
| 433 void fullFramePluginZoomLevelChanged(double zoomLevel); | 433 void fullFramePluginZoomLevelChanged(double zoomLevel); |
| 434 | 434 |
| 435 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe
ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale
, WebPoint& scroll); | 435 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe
ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale
, WebPoint& scroll); |
| 436 WebCore::Node* bestTapNode(const WebCore::PlatformGestureEvent& tapEvent); | 436 blink::Node* bestTapNode(const blink::PlatformGestureEvent& tapEvent); |
| 437 void enableTapHighlightAtPoint(const WebCore::PlatformGestureEvent& tapEvent
); | 437 void enableTapHighlightAtPoint(const blink::PlatformGestureEvent& tapEvent); |
| 438 void enableTapHighlights(WillBeHeapVector<RawPtrWillBeMember<WebCore::Node>
>&); | 438 void enableTapHighlights(WillBeHeapVector<RawPtrWillBeMember<blink::Node> >&
); |
| 439 void computeScaleAndScrollForFocusedNode(WebCore::Node* focusedNode, float&
scale, WebCore::IntPoint& scroll, bool& needAnimation); | 439 void computeScaleAndScrollForFocusedNode(blink::Node* focusedNode, float& sc
ale, blink::IntPoint& scroll, bool& needAnimation); |
| 440 | 440 |
| 441 void animateDoubleTapZoom(const WebCore::IntPoint&); | 441 void animateDoubleTapZoom(const blink::IntPoint&); |
| 442 | 442 |
| 443 void enableFakePageScaleAnimationForTesting(bool); | 443 void enableFakePageScaleAnimationForTesting(bool); |
| 444 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo
mPending; } | 444 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo
mPending; } |
| 445 WebCore::IntPoint fakePageScaleAnimationTargetPositionForTesting() const { r
eturn m_fakePageScaleAnimationTargetPosition; } | 445 blink::IntPoint fakePageScaleAnimationTargetPositionForTesting() const { ret
urn m_fakePageScaleAnimationTargetPosition; } |
| 446 float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageS
caleAnimationPageScaleFactor; } | 446 float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageS
caleAnimationPageScaleFactor; } |
| 447 bool fakePageScaleAnimationUseAnchorForTesting() const { return m_fakePageSc
aleAnimationUseAnchor; } | 447 bool fakePageScaleAnimationUseAnchorForTesting() const { return m_fakePageSc
aleAnimationUseAnchor; } |
| 448 | 448 |
| 449 void enterFullScreenForElement(WebCore::Element*); | 449 void enterFullScreenForElement(blink::Element*); |
| 450 void exitFullScreenForElement(WebCore::Element*); | 450 void exitFullScreenForElement(blink::Element*); |
| 451 | 451 |
| 452 void clearCompositedSelectionBounds(); | 452 void clearCompositedSelectionBounds(); |
| 453 | 453 |
| 454 // Exposed for the purpose of overriding device metrics. | 454 // Exposed for the purpose of overriding device metrics. |
| 455 void sendResizeEventAndRepaint(); | 455 void sendResizeEventAndRepaint(); |
| 456 | 456 |
| 457 // Exposed for testing purposes. | 457 // Exposed for testing purposes. |
| 458 bool hasHorizontalScrollbar(); | 458 bool hasHorizontalScrollbar(); |
| 459 bool hasVerticalScrollbar(); | 459 bool hasVerticalScrollbar(); |
| 460 | 460 |
| 461 // Pointer Lock calls allow a page to capture all mouse events and | 461 // Pointer Lock calls allow a page to capture all mouse events and |
| 462 // disable the system cursor. | 462 // disable the system cursor. |
| 463 bool requestPointerLock(); | 463 bool requestPointerLock(); |
| 464 void requestPointerUnlock(); | 464 void requestPointerUnlock(); |
| 465 bool isPointerLocked(); | 465 bool isPointerLocked(); |
| 466 | 466 |
| 467 // Heuristic-based function for determining if we should disable workarounds | 467 // Heuristic-based function for determining if we should disable workarounds |
| 468 // for viewing websites that are not optimized for mobile devices. | 468 // for viewing websites that are not optimized for mobile devices. |
| 469 bool shouldDisableDesktopWorkarounds(); | 469 bool shouldDisableDesktopWorkarounds(); |
| 470 | 470 |
| 471 // Exposed for tests. | 471 // Exposed for tests. |
| 472 unsigned numLinkHighlights() { return m_linkHighlights.size(); } | 472 unsigned numLinkHighlights() { return m_linkHighlights.size(); } |
| 473 LinkHighlight* linkHighlight(int i) { return m_linkHighlights[i].get(); } | 473 LinkHighlight* linkHighlight(int i) { return m_linkHighlights[i].get(); } |
| 474 | 474 |
| 475 WebSettingsImpl* settingsImpl(); | 475 WebSettingsImpl* settingsImpl(); |
| 476 | 476 |
| 477 // Returns the bounding box of the block type node touched by the WebRect. | 477 // Returns the bounding box of the block type node touched by the WebRect. |
| 478 WebRect computeBlockBounds(const WebRect&, bool ignoreClipping); | 478 WebRect computeBlockBounds(const WebRect&, bool ignoreClipping); |
| 479 | 479 |
| 480 WebCore::IntPoint clampOffsetAtScale(const WebCore::IntPoint& offset, float
scale); | 480 blink::IntPoint clampOffsetAtScale(const blink::IntPoint& offset, float scal
e); |
| 481 | 481 |
| 482 // Exposed for tests. | 482 // Exposed for tests. |
| 483 WebVector<WebCompositionUnderline> compositionUnderlines() const; | 483 WebVector<WebCompositionUnderline> compositionUnderlines() const; |
| 484 | 484 |
| 485 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } | 485 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } |
| 486 | 486 |
| 487 bool pinchVirtualViewportEnabled() const; | 487 bool pinchVirtualViewportEnabled() const; |
| 488 | 488 |
| 489 bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_match
esHeuristicsForGpuRasterization; } | 489 bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_match
esHeuristicsForGpuRasterization; } |
| 490 | 490 |
| 491 private: | 491 private: |
| 492 // TODO(bokan): Remains for legacy pinch. Remove once it's gone. Made privat
e to | 492 // TODO(bokan): Remains for legacy pinch. Remove once it's gone. Made privat
e to |
| 493 // prevent external usage | 493 // prevent external usage |
| 494 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) O
VERRIDE; | 494 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) O
VERRIDE; |
| 495 | 495 |
| 496 float legibleScale() const; | 496 float legibleScale() const; |
| 497 void refreshPageScaleFactorAfterLayout(); | 497 void refreshPageScaleFactorAfterLayout(); |
| 498 void resumeTreeViewCommits(); | 498 void resumeTreeViewCommits(); |
| 499 void setUserAgentPageScaleConstraints(WebCore::PageScaleConstraints newConst
raints); | 499 void setUserAgentPageScaleConstraints(blink::PageScaleConstraints newConstra
ints); |
| 500 float clampPageScaleFactorToLimits(float) const; | 500 float clampPageScaleFactorToLimits(float) const; |
| 501 WebCore::IntSize contentsSize() const; | 501 blink::IntSize contentsSize() const; |
| 502 | 502 |
| 503 void resetSavedScrollAndScaleState(); | 503 void resetSavedScrollAndScaleState(); |
| 504 | 504 |
| 505 void updateMainFrameScrollPosition(const WebCore::IntPoint& scrollPosition,
bool programmaticScroll); | 505 void updateMainFrameScrollPosition(const blink::IntPoint& scrollPosition, bo
ol programmaticScroll); |
| 506 | 506 |
| 507 void performResize(); | 507 void performResize(); |
| 508 | 508 |
| 509 friend class WebView; // So WebView::Create can call our constructor | 509 friend class WebView; // So WebView::Create can call our constructor |
| 510 friend class WTF::RefCounted<WebViewImpl>; | 510 friend class WTF::RefCounted<WebViewImpl>; |
| 511 friend void setCurrentInputEventForTest(const WebInputEvent*); | 511 friend void setCurrentInputEventForTest(const WebInputEvent*); |
| 512 | 512 |
| 513 enum DragAction { | 513 enum DragAction { |
| 514 DragEnter, | 514 DragEnter, |
| 515 DragOver | 515 DragOver |
| (...skipping 11 matching lines...) Expand all Loading... |
| 527 | 527 |
| 528 bool confirmComposition(const WebString& text, ConfirmCompositionBehavior); | 528 bool confirmComposition(const WebString& text, ConfirmCompositionBehavior); |
| 529 | 529 |
| 530 // Returns true if the view was scrolled. | 530 // Returns true if the view was scrolled. |
| 531 bool scrollViewWithKeyboard(int keyCode, int modifiers); | 531 bool scrollViewWithKeyboard(int keyCode, int modifiers); |
| 532 | 532 |
| 533 void hideSelectPopup(); | 533 void hideSelectPopup(); |
| 534 | 534 |
| 535 // Converts |pos| from window coordinates to contents coordinates and gets | 535 // Converts |pos| from window coordinates to contents coordinates and gets |
| 536 // the HitTestResult for it. | 536 // the HitTestResult for it. |
| 537 WebCore::HitTestResult hitTestResultForWindowPos(const WebCore::IntPoint&); | 537 blink::HitTestResult hitTestResultForWindowPos(const blink::IntPoint&); |
| 538 | 538 |
| 539 // Consolidate some common code between starting a drag over a target and | 539 // Consolidate some common code between starting a drag over a target and |
| 540 // updating a drag over a target. If we're starting a drag, |isEntering| | 540 // updating a drag over a target. If we're starting a drag, |isEntering| |
| 541 // should be true. | 541 // should be true. |
| 542 WebDragOperation dragTargetDragEnterOrOver(const WebPoint& clientPoint, | 542 WebDragOperation dragTargetDragEnterOrOver(const WebPoint& clientPoint, |
| 543 const WebPoint& screenPoint, | 543 const WebPoint& screenPoint, |
| 544 DragAction, | 544 DragAction, |
| 545 int keyModifiers); | 545 int keyModifiers); |
| 546 | 546 |
| 547 void configureAutoResizeMode(); | 547 void configureAutoResizeMode(); |
| 548 | 548 |
| 549 void setIsAcceleratedCompositingActive(bool); | 549 void setIsAcceleratedCompositingActive(bool); |
| 550 void doComposite(); | 550 void doComposite(); |
| 551 void reallocateRenderer(); | 551 void reallocateRenderer(); |
| 552 void updateLayerTreeViewport(); | 552 void updateLayerTreeViewport(); |
| 553 void updateLayerTreeBackgroundColor(); | 553 void updateLayerTreeBackgroundColor(); |
| 554 void updateRootLayerTransform(); | 554 void updateRootLayerTransform(); |
| 555 void updateLayerTreeDeviceScaleFactor(); | 555 void updateLayerTreeDeviceScaleFactor(); |
| 556 | 556 |
| 557 // Helper function: Widens the width of |source| by the specified margins | 557 // Helper function: Widens the width of |source| by the specified margins |
| 558 // while keeping it smaller than page width. | 558 // while keeping it smaller than page width. |
| 559 WebRect widenRectWithinPageBounds(const WebRect& source, int targetMargin, i
nt minimumMargin); | 559 WebRect widenRectWithinPageBounds(const WebRect& source, int targetMargin, i
nt minimumMargin); |
| 560 | 560 |
| 561 void pointerLockMouseEvent(const WebInputEvent&); | 561 void pointerLockMouseEvent(const WebInputEvent&); |
| 562 | 562 |
| 563 // PageWidgetEventHandler functions | 563 // PageWidgetEventHandler functions |
| 564 virtual void handleMouseLeave(WebCore::LocalFrame&, const WebMouseEvent&) OV
ERRIDE; | 564 virtual void handleMouseLeave(blink::LocalFrame&, const WebMouseEvent&) OVER
RIDE; |
| 565 virtual void handleMouseDown(WebCore::LocalFrame&, const WebMouseEvent&) OVE
RRIDE; | 565 virtual void handleMouseDown(blink::LocalFrame&, const WebMouseEvent&) OVERR
IDE; |
| 566 virtual void handleMouseUp(WebCore::LocalFrame&, const WebMouseEvent&) OVERR
IDE; | 566 virtual void handleMouseUp(blink::LocalFrame&, const WebMouseEvent&) OVERRID
E; |
| 567 virtual bool handleMouseWheel(WebCore::LocalFrame&, const WebMouseWheelEvent
&) OVERRIDE; | 567 virtual bool handleMouseWheel(blink::LocalFrame&, const WebMouseWheelEvent&)
OVERRIDE; |
| 568 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE; | 568 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE; |
| 569 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; | 569 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; |
| 570 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE; | 570 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE; |
| 571 | 571 |
| 572 WebCore::InputMethodContext* inputMethodContext(); | 572 blink::InputMethodContext* inputMethodContext(); |
| 573 WebPlugin* focusedPluginIfInputMethodSupported(WebCore::LocalFrame*); | 573 WebPlugin* focusedPluginIfInputMethodSupported(blink::LocalFrame*); |
| 574 | 574 |
| 575 WebViewClient* m_client; // Can be 0 (e.g. unittests, shared workers, etc.) | 575 WebViewClient* m_client; // Can be 0 (e.g. unittests, shared workers, etc.) |
| 576 WebAutofillClient* m_autofillClient; | 576 WebAutofillClient* m_autofillClient; |
| 577 WebSpellCheckClient* m_spellCheckClient; | 577 WebSpellCheckClient* m_spellCheckClient; |
| 578 | 578 |
| 579 ChromeClientImpl m_chromeClientImpl; | 579 ChromeClientImpl m_chromeClientImpl; |
| 580 ContextMenuClientImpl m_contextMenuClientImpl; | 580 ContextMenuClientImpl m_contextMenuClientImpl; |
| 581 DragClientImpl m_dragClientImpl; | 581 DragClientImpl m_dragClientImpl; |
| 582 EditorClientImpl m_editorClientImpl; | 582 EditorClientImpl m_editorClientImpl; |
| 583 InspectorClientImpl m_inspectorClientImpl; | 583 InspectorClientImpl m_inspectorClientImpl; |
| 584 BackForwardClientImpl m_backForwardClientImpl; | 584 BackForwardClientImpl m_backForwardClientImpl; |
| 585 SpellCheckerClientImpl m_spellCheckerClientImpl; | 585 SpellCheckerClientImpl m_spellCheckerClientImpl; |
| 586 StorageClientImpl m_storageClientImpl; | 586 StorageClientImpl m_storageClientImpl; |
| 587 | 587 |
| 588 WebSize m_size; | 588 WebSize m_size; |
| 589 bool m_fixedLayoutSizeLock; | 589 bool m_fixedLayoutSizeLock; |
| 590 // If true, automatically resize the render view around its content. | 590 // If true, automatically resize the render view around its content. |
| 591 bool m_shouldAutoResize; | 591 bool m_shouldAutoResize; |
| 592 // The lower bound on the size when auto-resizing. | 592 // The lower bound on the size when auto-resizing. |
| 593 WebCore::IntSize m_minAutoSize; | 593 blink::IntSize m_minAutoSize; |
| 594 // The upper bound on the size when auto-resizing. | 594 // The upper bound on the size when auto-resizing. |
| 595 WebCore::IntSize m_maxAutoSize; | 595 blink::IntSize m_maxAutoSize; |
| 596 | 596 |
| 597 OwnPtrWillBePersistent<WebCore::Page> m_page; | 597 OwnPtrWillBePersistent<blink::Page> m_page; |
| 598 | 598 |
| 599 // An object that can be used to manipulate m_page->settings() without linki
ng | 599 // An object that can be used to manipulate m_page->settings() without linki
ng |
| 600 // against WebCore. This is lazily allocated the first time GetWebSettings() | 600 // against WebCore. This is lazily allocated the first time GetWebSettings() |
| 601 // is called. | 601 // is called. |
| 602 OwnPtr<WebSettingsImpl> m_webSettings; | 602 OwnPtr<WebSettingsImpl> m_webSettings; |
| 603 | 603 |
| 604 // A copy of the web drop data object we received from the browser. | 604 // A copy of the web drop data object we received from the browser. |
| 605 RefPtrWillBePersistent<WebCore::DataObject> m_currentDragData; | 605 RefPtrWillBePersistent<blink::DataObject> m_currentDragData; |
| 606 | 606 |
| 607 // The point relative to the client area where the mouse was last pressed | 607 // The point relative to the client area where the mouse was last pressed |
| 608 // down. This is used by the drag client to determine what was under the | 608 // down. This is used by the drag client to determine what was under the |
| 609 // mouse when the drag was initiated. We need to track this here in | 609 // mouse when the drag was initiated. We need to track this here in |
| 610 // WebViewImpl since DragClient::startDrag does not pass the position the | 610 // WebViewImpl since DragClient::startDrag does not pass the position the |
| 611 // mouse was at when the drag was initiated, only the current point, which | 611 // mouse was at when the drag was initiated, only the current point, which |
| 612 // can be misleading as it is usually not over the element the user actually | 612 // can be misleading as it is usually not over the element the user actually |
| 613 // dragged by the time a drag is initiated. | 613 // dragged by the time a drag is initiated. |
| 614 WebPoint m_lastMouseDownPoint; | 614 WebPoint m_lastMouseDownPoint; |
| 615 | 615 |
| 616 // Keeps track of the current zoom level. 0 means no zoom, positive numbers | 616 // Keeps track of the current zoom level. 0 means no zoom, positive numbers |
| 617 // mean zoom in, negative numbers mean zoom out. | 617 // mean zoom in, negative numbers mean zoom out. |
| 618 double m_zoomLevel; | 618 double m_zoomLevel; |
| 619 | 619 |
| 620 double m_minimumZoomLevel; | 620 double m_minimumZoomLevel; |
| 621 | 621 |
| 622 double m_maximumZoomLevel; | 622 double m_maximumZoomLevel; |
| 623 | 623 |
| 624 PageScaleConstraintsSet m_pageScaleConstraintsSet; | 624 PageScaleConstraintsSet m_pageScaleConstraintsSet; |
| 625 | 625 |
| 626 // The scale moved to by the latest double tap zoom, if any. | 626 // The scale moved to by the latest double tap zoom, if any. |
| 627 float m_doubleTapZoomPageScaleFactor; | 627 float m_doubleTapZoomPageScaleFactor; |
| 628 // Have we sent a double-tap zoom and not yet heard back the scale? | 628 // Have we sent a double-tap zoom and not yet heard back the scale? |
| 629 bool m_doubleTapZoomPending; | 629 bool m_doubleTapZoomPending; |
| 630 | 630 |
| 631 // Used for testing purposes. | 631 // Used for testing purposes. |
| 632 bool m_enableFakePageScaleAnimationForTesting; | 632 bool m_enableFakePageScaleAnimationForTesting; |
| 633 WebCore::IntPoint m_fakePageScaleAnimationTargetPosition; | 633 blink::IntPoint m_fakePageScaleAnimationTargetPosition; |
| 634 float m_fakePageScaleAnimationPageScaleFactor; | 634 float m_fakePageScaleAnimationPageScaleFactor; |
| 635 bool m_fakePageScaleAnimationUseAnchor; | 635 bool m_fakePageScaleAnimationUseAnchor; |
| 636 | 636 |
| 637 bool m_contextMenuAllowed; | 637 bool m_contextMenuAllowed; |
| 638 | 638 |
| 639 bool m_doingDragAndDrop; | 639 bool m_doingDragAndDrop; |
| 640 | 640 |
| 641 bool m_ignoreInputEvents; | 641 bool m_ignoreInputEvents; |
| 642 | 642 |
| 643 float m_compositorDeviceScaleFactorOverride; | 643 float m_compositorDeviceScaleFactorOverride; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 // Whether the user can press tab to focus links. | 676 // Whether the user can press tab to focus links. |
| 677 bool m_tabsToLinks; | 677 bool m_tabsToLinks; |
| 678 | 678 |
| 679 // Inspector settings. | 679 // Inspector settings. |
| 680 WebString m_inspectorSettings; | 680 WebString m_inspectorSettings; |
| 681 | 681 |
| 682 typedef HashMap<WTF::String, WTF::String> SettingsMap; | 682 typedef HashMap<WTF::String, WTF::String> SettingsMap; |
| 683 OwnPtr<SettingsMap> m_inspectorSettingsMap; | 683 OwnPtr<SettingsMap> m_inspectorSettingsMap; |
| 684 | 684 |
| 685 // If set, the (plugin) node which has mouse capture. | 685 // If set, the (plugin) node which has mouse capture. |
| 686 RefPtrWillBePersistent<WebCore::Node> m_mouseCaptureNode; | 686 RefPtrWillBePersistent<blink::Node> m_mouseCaptureNode; |
| 687 RefPtr<WebCore::UserGestureToken> m_mouseCaptureGestureToken; | 687 RefPtr<blink::UserGestureToken> m_mouseCaptureGestureToken; |
| 688 | 688 |
| 689 WebCore::IntRect m_rootLayerScrollDamage; | 689 blink::IntRect m_rootLayerScrollDamage; |
| 690 WebLayerTreeView* m_layerTreeView; | 690 WebLayerTreeView* m_layerTreeView; |
| 691 WebLayer* m_rootLayer; | 691 WebLayer* m_rootLayer; |
| 692 WebCore::GraphicsLayer* m_rootGraphicsLayer; | 692 blink::GraphicsLayer* m_rootGraphicsLayer; |
| 693 WebCore::GraphicsLayer* m_rootTransformLayer; | 693 blink::GraphicsLayer* m_rootTransformLayer; |
| 694 OwnPtr<WebCore::GraphicsLayerFactory> m_graphicsLayerFactory; | 694 OwnPtr<blink::GraphicsLayerFactory> m_graphicsLayerFactory; |
| 695 bool m_isAcceleratedCompositingActive; | 695 bool m_isAcceleratedCompositingActive; |
| 696 bool m_layerTreeViewCommitsDeferred; | 696 bool m_layerTreeViewCommitsDeferred; |
| 697 bool m_layerTreeViewClosed; | 697 bool m_layerTreeViewClosed; |
| 698 bool m_matchesHeuristicsForGpuRasterization; | 698 bool m_matchesHeuristicsForGpuRasterization; |
| 699 // If true, the graphics context is being restored. | 699 // If true, the graphics context is being restored. |
| 700 bool m_recreatingGraphicsContext; | 700 bool m_recreatingGraphicsContext; |
| 701 static const WebInputEvent* m_currentInputEvent; | 701 static const WebInputEvent* m_currentInputEvent; |
| 702 | 702 |
| 703 MediaKeysClientImpl m_mediaKeysClientImpl; | 703 MediaKeysClientImpl m_mediaKeysClientImpl; |
| 704 OwnPtr<WebActiveGestureAnimation> m_gestureAnimation; | 704 OwnPtr<WebActiveGestureAnimation> m_gestureAnimation; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 721 bool m_userGestureObserved; | 721 bool m_userGestureObserved; |
| 722 }; | 722 }; |
| 723 | 723 |
| 724 // We have no ways to check if the specified WebView is an instance of | 724 // We have no ways to check if the specified WebView is an instance of |
| 725 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 725 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
| 726 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 726 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
| 727 | 727 |
| 728 } // namespace blink | 728 } // namespace blink |
| 729 | 729 |
| 730 #endif | 730 #endif |
| OLD | NEW |