| 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 379 } |
| 380 | 380 |
| 381 // static | 381 // static |
| 382 HashSet<WebViewImpl*>& WebViewImpl::allInstances() { | 382 HashSet<WebViewImpl*>& WebViewImpl::allInstances() { |
| 383 DEFINE_STATIC_LOCAL(HashSet<WebViewImpl*>, allInstances, ()); | 383 DEFINE_STATIC_LOCAL(HashSet<WebViewImpl*>, allInstances, ()); |
| 384 return allInstances; | 384 return allInstances; |
| 385 } | 385 } |
| 386 | 386 |
| 387 WebViewImpl::WebViewImpl(WebViewClient* client, | 387 WebViewImpl::WebViewImpl(WebViewClient* client, |
| 388 WebPageVisibilityState visibilityState) | 388 WebPageVisibilityState visibilityState) |
| 389 : m_client(client), | 389 : m_doingDragAndDrop(false), |
| 390 m_client(client), |
| 390 m_spellCheckClient(nullptr), | 391 m_spellCheckClient(nullptr), |
| 391 m_chromeClientImpl(ChromeClientImpl::create(this)), | 392 m_chromeClientImpl(ChromeClientImpl::create(this)), |
| 392 m_contextMenuClientImpl(this), | 393 m_contextMenuClientImpl(this), |
| 393 m_editorClientImpl(this), | 394 m_editorClientImpl(this), |
| 394 m_spellCheckerClientImpl(this), | 395 m_spellCheckerClientImpl(this), |
| 395 m_storageClientImpl(this), | 396 m_storageClientImpl(this), |
| 396 m_shouldAutoResize(false), | 397 m_shouldAutoResize(false), |
| 397 m_zoomLevel(0), | 398 m_zoomLevel(0), |
| 398 m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier)), | 399 m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier)), |
| 399 m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier)), | 400 m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier)), |
| 400 m_zoomFactorForDeviceScaleFactor(0.f), | 401 m_zoomFactorForDeviceScaleFactor(0.f), |
| 401 m_maximumLegibleScale(1), | 402 m_maximumLegibleScale(1), |
| 402 m_doubleTapZoomPageScaleFactor(0), | 403 m_doubleTapZoomPageScaleFactor(0), |
| 403 m_doubleTapZoomPending(false), | 404 m_doubleTapZoomPending(false), |
| 404 m_enableFakePageScaleAnimationForTesting(false), | 405 m_enableFakePageScaleAnimationForTesting(false), |
| 405 m_fakePageScaleAnimationPageScaleFactor(0), | 406 m_fakePageScaleAnimationPageScaleFactor(0), |
| 406 m_fakePageScaleAnimationUseAnchor(false), | 407 m_fakePageScaleAnimationUseAnchor(false), |
| 407 m_doingDragAndDrop(false), | |
| 408 m_ignoreInputEvents(false), | 408 m_ignoreInputEvents(false), |
| 409 m_compositorDeviceScaleFactorOverride(0), | 409 m_compositorDeviceScaleFactorOverride(0), |
| 410 m_suppressNextKeypressEvent(false), | 410 m_suppressNextKeypressEvent(false), |
| 411 m_imeAcceptEvents(true), | 411 m_imeAcceptEvents(true), |
| 412 m_operationsAllowed(WebDragOperationNone), | 412 m_operationsAllowed(WebDragOperationNone), |
| 413 m_dragOperation(WebDragOperationNone), | 413 m_dragOperation(WebDragOperationNone), |
| 414 m_devToolsEmulator(nullptr), | 414 m_devToolsEmulator(nullptr), |
| 415 m_isTransparent(false), | 415 m_isTransparent(false), |
| 416 m_tabsToLinks(false), | 416 m_tabsToLinks(false), |
| 417 m_layerTreeView(nullptr), | 417 m_layerTreeView(nullptr), |
| (...skipping 3519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3937 } | 3937 } |
| 3938 | 3938 |
| 3939 void WebViewImpl::mainFrameScrollOffsetChanged() { | 3939 void WebViewImpl::mainFrameScrollOffsetChanged() { |
| 3940 m_devToolsEmulator->mainFrameScrollOrScaleChanged(); | 3940 m_devToolsEmulator->mainFrameScrollOrScaleChanged(); |
| 3941 } | 3941 } |
| 3942 | 3942 |
| 3943 bool WebViewImpl::useExternalPopupMenus() { | 3943 bool WebViewImpl::useExternalPopupMenus() { |
| 3944 return shouldUseExternalPopupMenus; | 3944 return shouldUseExternalPopupMenus; |
| 3945 } | 3945 } |
| 3946 | 3946 |
| 3947 void WebViewImpl::startDragging(LocalFrame* frame, | |
| 3948 const WebDragData& dragData, | |
| 3949 WebDragOperationsMask mask, | |
| 3950 const WebImage& dragImage, | |
| 3951 const WebPoint& dragImageOffset) { | |
| 3952 if (!m_client) | |
| 3953 return; | |
| 3954 DCHECK(!m_doingDragAndDrop); | |
| 3955 m_doingDragAndDrop = true; | |
| 3956 m_client->startDragging(WebLocalFrameImpl::fromFrame(frame), dragData, mask, | |
| 3957 dragImage, dragImageOffset); | |
| 3958 } | |
| 3959 | |
| 3960 void WebViewImpl::setIgnoreInputEvents(bool newValue) { | 3947 void WebViewImpl::setIgnoreInputEvents(bool newValue) { |
| 3961 DCHECK_NE(m_ignoreInputEvents, newValue); | 3948 DCHECK_NE(m_ignoreInputEvents, newValue); |
| 3962 m_ignoreInputEvents = newValue; | 3949 m_ignoreInputEvents = newValue; |
| 3963 } | 3950 } |
| 3964 | 3951 |
| 3965 void WebViewImpl::setBackgroundColorOverride(WebColor color) { | 3952 void WebViewImpl::setBackgroundColorOverride(WebColor color) { |
| 3966 m_backgroundColorOverride = color; | 3953 m_backgroundColorOverride = color; |
| 3967 updateLayerTreeBackgroundColor(); | 3954 updateLayerTreeBackgroundColor(); |
| 3968 } | 3955 } |
| 3969 | 3956 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4443 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4430 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4444 return nullptr; | 4431 return nullptr; |
| 4445 return focusedFrame; | 4432 return focusedFrame; |
| 4446 } | 4433 } |
| 4447 | 4434 |
| 4448 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4435 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4449 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4436 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4450 } | 4437 } |
| 4451 | 4438 |
| 4452 } // namespace blink | 4439 } // namespace blink |
| OLD | NEW |