| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "SpeechInputClientImpl.h" | 48 #include "SpeechInputClientImpl.h" |
| 49 #include "SpeechRecognitionClientProxy.h" | 49 #include "SpeechRecognitionClientProxy.h" |
| 50 #include "StorageQuotaClientImpl.h" | 50 #include "StorageQuotaClientImpl.h" |
| 51 #include "ValidationMessageClientImpl.h" | 51 #include "ValidationMessageClientImpl.h" |
| 52 #include "ViewportAnchor.h" | 52 #include "ViewportAnchor.h" |
| 53 #include "WebAXObject.h" | 53 #include "WebAXObject.h" |
| 54 #include "WebActiveWheelFlingParameters.h" | 54 #include "WebActiveWheelFlingParameters.h" |
| 55 #include "WebAutofillClient.h" | 55 #include "WebAutofillClient.h" |
| 56 #include "WebDevToolsAgentImpl.h" | 56 #include "WebDevToolsAgentImpl.h" |
| 57 #include "WebDevToolsAgentPrivate.h" | 57 #include "WebDevToolsAgentPrivate.h" |
| 58 #include "WebFrameImpl.h" | |
| 59 #include "WebHitTestResult.h" | 58 #include "WebHitTestResult.h" |
| 60 #include "WebInputElement.h" | 59 #include "WebInputElement.h" |
| 61 #include "WebInputEventConversion.h" | 60 #include "WebInputEventConversion.h" |
| 61 #include "WebLocalFrameImpl.h" |
| 62 #include "WebMediaPlayerAction.h" | 62 #include "WebMediaPlayerAction.h" |
| 63 #include "WebNode.h" | 63 #include "WebNode.h" |
| 64 #include "WebPagePopupImpl.h" | 64 #include "WebPagePopupImpl.h" |
| 65 #include "WebPlugin.h" | 65 #include "WebPlugin.h" |
| 66 #include "WebPluginAction.h" | 66 #include "WebPluginAction.h" |
| 67 #include "WebPluginContainerImpl.h" | 67 #include "WebPluginContainerImpl.h" |
| 68 #include "WebPopupMenuImpl.h" | 68 #include "WebPopupMenuImpl.h" |
| 69 #include "WebRange.h" | 69 #include "WebRange.h" |
| 70 #include "WebSettingsImpl.h" | 70 #include "WebSettingsImpl.h" |
| 71 #include "WebTextInputInfo.h" | 71 #include "WebTextInputInfo.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 void WebView::didExitModalLoop() | 311 void WebView::didExitModalLoop() |
| 312 { | 312 { |
| 313 ASSERT(pageLoadDeferrerStack().size()); | 313 ASSERT(pageLoadDeferrerStack().size()); |
| 314 | 314 |
| 315 delete pageLoadDeferrerStack().last(); | 315 delete pageLoadDeferrerStack().last(); |
| 316 pageLoadDeferrerStack().removeLast(); | 316 pageLoadDeferrerStack().removeLast(); |
| 317 } | 317 } |
| 318 | 318 |
| 319 void WebViewImpl::setMainFrame(WebFrame* frame) | 319 void WebViewImpl::setMainFrame(WebFrame* frame) |
| 320 { | 320 { |
| 321 toWebFrameImpl(frame)->initializeAsMainFrame(page()); | 321 toWebLocalFrameImpl(frame)->initializeAsMainFrame(page()); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void WebViewImpl::setAutofillClient(WebAutofillClient* autofillClient) | 324 void WebViewImpl::setAutofillClient(WebAutofillClient* autofillClient) |
| 325 { | 325 { |
| 326 m_autofillClient = autofillClient; | 326 m_autofillClient = autofillClient; |
| 327 } | 327 } |
| 328 | 328 |
| 329 void WebViewImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) | 329 void WebViewImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) |
| 330 { | 330 { |
| 331 if (devToolsClient) | 331 if (devToolsClient) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 450 } |
| 451 | 451 |
| 452 m_inspectorSettingsMap = adoptPtr(new SettingsMap); | 452 m_inspectorSettingsMap = adoptPtr(new SettingsMap); |
| 453 } | 453 } |
| 454 | 454 |
| 455 WebViewImpl::~WebViewImpl() | 455 WebViewImpl::~WebViewImpl() |
| 456 { | 456 { |
| 457 ASSERT(!m_page); | 457 ASSERT(!m_page); |
| 458 } | 458 } |
| 459 | 459 |
| 460 WebFrameImpl* WebViewImpl::mainFrameImpl() | 460 WebLocalFrameImpl* WebViewImpl::mainFrameImpl() |
| 461 { | 461 { |
| 462 return m_page ? WebFrameImpl::fromFrame(m_page->mainFrame()) : 0; | 462 return m_page ? WebLocalFrameImpl::fromFrame(m_page->mainFrame()) : 0; |
| 463 } | 463 } |
| 464 | 464 |
| 465 bool WebViewImpl::tabKeyCyclesThroughElements() const | 465 bool WebViewImpl::tabKeyCyclesThroughElements() const |
| 466 { | 466 { |
| 467 ASSERT(m_page); | 467 ASSERT(m_page); |
| 468 return m_page->tabKeyCyclesThroughElements(); | 468 return m_page->tabKeyCyclesThroughElements(); |
| 469 } | 469 } |
| 470 | 470 |
| 471 void WebViewImpl::setTabKeyCyclesThroughElements(bool value) | 471 void WebViewImpl::setTabKeyCyclesThroughElements(bool value) |
| 472 { | 472 { |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 m_pagePopup->handleKeyEvent(PlatformKeyboardEventBuilder(event)); | 937 m_pagePopup->handleKeyEvent(PlatformKeyboardEventBuilder(event)); |
| 938 // We need to ignore the next Char event after this otherwise pressing | 938 // We need to ignore the next Char event after this otherwise pressing |
| 939 // enter when selecting an item in the popup will go to the page. | 939 // enter when selecting an item in the popup will go to the page. |
| 940 if (WebInputEvent::RawKeyDown == event.type) | 940 if (WebInputEvent::RawKeyDown == event.type) |
| 941 m_suppressNextKeypressEvent = true; | 941 m_suppressNextKeypressEvent = true; |
| 942 return true; | 942 return true; |
| 943 } | 943 } |
| 944 | 944 |
| 945 RefPtr<Frame> focusedFrame = focusedWebCoreFrame(); | 945 RefPtr<Frame> focusedFrame = focusedWebCoreFrame(); |
| 946 if (focusedFrame && focusedFrame->isRemoteFrameTemporary()) { | 946 if (focusedFrame && focusedFrame->isRemoteFrameTemporary()) { |
| 947 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(toLocalFrameTemporary(f
ocusedFrame.get())); | 947 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(toLocalFrameT
emporary(focusedFrame.get())); |
| 948 webFrame->client()->forwardInputEvent(&event); | 948 webFrame->client()->forwardInputEvent(&event); |
| 949 return true; | 949 return true; |
| 950 } | 950 } |
| 951 | 951 |
| 952 if (!focusedFrame || !focusedFrame->isLocalFrame()) | 952 if (!focusedFrame || !focusedFrame->isLocalFrame()) |
| 953 return false; | 953 return false; |
| 954 | 954 |
| 955 RefPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get()); | 955 RefPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get()); |
| 956 | 956 |
| 957 PlatformKeyboardEventBuilder evt(event); | 957 PlatformKeyboardEventBuilder evt(event); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 | 1563 |
| 1564 deref(); // Balances ref() acquired in WebView::create | 1564 deref(); // Balances ref() acquired in WebView::create |
| 1565 } | 1565 } |
| 1566 | 1566 |
| 1567 void WebViewImpl::willStartLiveResize() | 1567 void WebViewImpl::willStartLiveResize() |
| 1568 { | 1568 { |
| 1569 if (mainFrameImpl() && mainFrameImpl()->frameView()) | 1569 if (mainFrameImpl() && mainFrameImpl()->frameView()) |
| 1570 mainFrameImpl()->frameView()->willStartLiveResize(); | 1570 mainFrameImpl()->frameView()->willStartLiveResize(); |
| 1571 | 1571 |
| 1572 LocalFrame* frame = mainFrameImpl()->frame(); | 1572 LocalFrame* frame = mainFrameImpl()->frame(); |
| 1573 WebPluginContainerImpl* pluginContainer = WebFrameImpl::pluginContainerFromF
rame(frame); | 1573 WebPluginContainerImpl* pluginContainer = WebLocalFrameImpl::pluginContainer
FromFrame(frame); |
| 1574 if (pluginContainer) | 1574 if (pluginContainer) |
| 1575 pluginContainer->willStartLiveResize(); | 1575 pluginContainer->willStartLiveResize(); |
| 1576 } | 1576 } |
| 1577 | 1577 |
| 1578 WebSize WebViewImpl::size() | 1578 WebSize WebViewImpl::size() |
| 1579 { | 1579 { |
| 1580 return m_size; | 1580 return m_size; |
| 1581 } | 1581 } |
| 1582 | 1582 |
| 1583 void WebViewImpl::resize(const WebSize& newSize) | 1583 void WebViewImpl::resize(const WebSize& newSize) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1607 { | 1607 { |
| 1608 // Avoids unnecessary invalidations while various bits of state in FastT
extAutosizer are updated. | 1608 // Avoids unnecessary invalidations while various bits of state in FastT
extAutosizer are updated. |
| 1609 FastTextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page()); | 1609 FastTextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page()); |
| 1610 | 1610 |
| 1611 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document(
)->viewportDescription()); | 1611 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document(
)->viewportDescription()); |
| 1612 updateMainFrameLayoutSize(); | 1612 updateMainFrameLayoutSize(); |
| 1613 | 1613 |
| 1614 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); | 1614 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); |
| 1615 if (agentPrivate) | 1615 if (agentPrivate) |
| 1616 agentPrivate->webViewResized(newSize); | 1616 agentPrivate->webViewResized(newSize); |
| 1617 WebFrameImpl* webFrame = mainFrameImpl(); | 1617 WebLocalFrameImpl* webFrame = mainFrameImpl(); |
| 1618 if (webFrame->frameView()) { | 1618 if (webFrame->frameView()) { |
| 1619 webFrame->frameView()->resize(m_size); | 1619 webFrame->frameView()->resize(m_size); |
| 1620 if (pinchVirtualViewportEnabled()) | 1620 if (pinchVirtualViewportEnabled()) |
| 1621 page()->frameHost().pinchViewport().mainFrameDidChangeSize(); | 1621 page()->frameHost().pinchViewport().mainFrameDidChangeSize(); |
| 1622 } | 1622 } |
| 1623 } | 1623 } |
| 1624 | 1624 |
| 1625 if (settings()->viewportEnabled() && !m_fixedLayoutSizeLock) { | 1625 if (settings()->viewportEnabled() && !m_fixedLayoutSizeLock) { |
| 1626 // Relayout immediately to recalculate the minimum scale limit. | 1626 // Relayout immediately to recalculate the minimum scale limit. |
| 1627 if (view->needsLayout()) | 1627 if (view->needsLayout()) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1647 | 1647 |
| 1648 sendResizeEventAndRepaint(); | 1648 sendResizeEventAndRepaint(); |
| 1649 } | 1649 } |
| 1650 | 1650 |
| 1651 void WebViewImpl::willEndLiveResize() | 1651 void WebViewImpl::willEndLiveResize() |
| 1652 { | 1652 { |
| 1653 if (mainFrameImpl() && mainFrameImpl()->frameView()) | 1653 if (mainFrameImpl() && mainFrameImpl()->frameView()) |
| 1654 mainFrameImpl()->frameView()->willEndLiveResize(); | 1654 mainFrameImpl()->frameView()->willEndLiveResize(); |
| 1655 | 1655 |
| 1656 LocalFrame* frame = mainFrameImpl()->frame(); | 1656 LocalFrame* frame = mainFrameImpl()->frame(); |
| 1657 WebPluginContainerImpl* pluginContainer = WebFrameImpl::pluginContainerFromF
rame(frame); | 1657 WebPluginContainerImpl* pluginContainer = WebLocalFrameImpl::pluginContainer
FromFrame(frame); |
| 1658 if (pluginContainer) | 1658 if (pluginContainer) |
| 1659 pluginContainer->willEndLiveResize(); | 1659 pluginContainer->willEndLiveResize(); |
| 1660 } | 1660 } |
| 1661 | 1661 |
| 1662 void WebViewImpl::willEnterFullScreen() | 1662 void WebViewImpl::willEnterFullScreen() |
| 1663 { | 1663 { |
| 1664 m_fullscreenController->willEnterFullScreen(); | 1664 m_fullscreenController->willEnterFullScreen(); |
| 1665 } | 1665 } |
| 1666 | 1666 |
| 1667 void WebViewImpl::didEnterFullScreen() | 1667 void WebViewImpl::didEnterFullScreen() |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2252 | 2252 |
| 2253 Element* target = focusedFrame->document()->focusedElement(); | 2253 Element* target = focusedFrame->document()->focusedElement(); |
| 2254 if (target && target->hasInputMethodContext()) | 2254 if (target && target->hasInputMethodContext()) |
| 2255 return &target->inputMethodContext(); | 2255 return &target->inputMethodContext(); |
| 2256 | 2256 |
| 2257 return 0; | 2257 return 0; |
| 2258 } | 2258 } |
| 2259 | 2259 |
| 2260 WebPlugin* WebViewImpl::focusedPluginIfInputMethodSupported(LocalFrame* frame) | 2260 WebPlugin* WebViewImpl::focusedPluginIfInputMethodSupported(LocalFrame* frame) |
| 2261 { | 2261 { |
| 2262 WebPluginContainerImpl* container = WebFrameImpl::pluginContainerFromNode(fr
ame, WebNode(focusedElement())); | 2262 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame, WebNode(focusedElement())); |
| 2263 if (container && container->supportsInputMethod()) | 2263 if (container && container->supportsInputMethod()) |
| 2264 return container->plugin(); | 2264 return container->plugin(); |
| 2265 return 0; | 2265 return 0; |
| 2266 } | 2266 } |
| 2267 | 2267 |
| 2268 void WebViewImpl::didShowCandidateWindow() | 2268 void WebViewImpl::didShowCandidateWindow() |
| 2269 { | 2269 { |
| 2270 if (InputMethodContext* context = inputMethodContext()) | 2270 if (InputMethodContext* context = inputMethodContext()) |
| 2271 context->dispatchCandidateWindowShowEvent(); | 2271 context->dispatchCandidateWindowShowEvent(); |
| 2272 } | 2272 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2455 WebFrame* WebViewImpl::mainFrame() | 2455 WebFrame* WebViewImpl::mainFrame() |
| 2456 { | 2456 { |
| 2457 return mainFrameImpl(); | 2457 return mainFrameImpl(); |
| 2458 } | 2458 } |
| 2459 | 2459 |
| 2460 WebFrame* WebViewImpl::findFrameByName( | 2460 WebFrame* WebViewImpl::findFrameByName( |
| 2461 const WebString& name, WebFrame* relativeToFrame) | 2461 const WebString& name, WebFrame* relativeToFrame) |
| 2462 { | 2462 { |
| 2463 if (!relativeToFrame) | 2463 if (!relativeToFrame) |
| 2464 relativeToFrame = mainFrame(); | 2464 relativeToFrame = mainFrame(); |
| 2465 LocalFrame* frame = toWebFrameImpl(relativeToFrame)->frame(); | 2465 LocalFrame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); |
| 2466 frame = frame->tree().find(name); | 2466 frame = frame->tree().find(name); |
| 2467 return WebFrameImpl::fromFrame(frame); | 2467 return WebLocalFrameImpl::fromFrame(frame); |
| 2468 } | 2468 } |
| 2469 | 2469 |
| 2470 WebFrame* WebViewImpl::focusedFrame() | 2470 WebFrame* WebViewImpl::focusedFrame() |
| 2471 { | 2471 { |
| 2472 return WebFrameImpl::fromFrame(toLocalFrame(focusedWebCoreFrame())); | 2472 return WebLocalFrameImpl::fromFrame(toLocalFrame(focusedWebCoreFrame())); |
| 2473 } | 2473 } |
| 2474 | 2474 |
| 2475 void WebViewImpl::setFocusedFrame(WebFrame* frame) | 2475 void WebViewImpl::setFocusedFrame(WebFrame* frame) |
| 2476 { | 2476 { |
| 2477 if (!frame) { | 2477 if (!frame) { |
| 2478 // Clears the focused frame if any. | 2478 // Clears the focused frame if any. |
| 2479 Frame* focusedFrame = focusedWebCoreFrame(); | 2479 Frame* focusedFrame = focusedWebCoreFrame(); |
| 2480 if (focusedFrame && focusedFrame->isLocalFrame()) | 2480 if (focusedFrame && focusedFrame->isLocalFrame()) |
| 2481 toLocalFrame(focusedFrame)->selection().setFocused(false); | 2481 toLocalFrame(focusedFrame)->selection().setFocused(false); |
| 2482 return; | 2482 return; |
| 2483 } | 2483 } |
| 2484 LocalFrame* webcoreFrame = toWebFrameImpl(frame)->frame(); | 2484 LocalFrame* webcoreFrame = toWebLocalFrameImpl(frame)->frame(); |
| 2485 webcoreFrame->page()->focusController().setFocusedFrame(webcoreFrame); | 2485 webcoreFrame->page()->focusController().setFocusedFrame(webcoreFrame); |
| 2486 } | 2486 } |
| 2487 | 2487 |
| 2488 void WebViewImpl::setInitialFocus(bool reverse) | 2488 void WebViewImpl::setInitialFocus(bool reverse) |
| 2489 { | 2489 { |
| 2490 if (!m_page) | 2490 if (!m_page) |
| 2491 return; | 2491 return; |
| 2492 Frame* frame = page()->focusController().focusedOrMainFrame(); | 2492 Frame* frame = page()->focusController().focusedOrMainFrame(); |
| 2493 if (frame->isLocalFrame()) { | 2493 if (frame->isLocalFrame()) { |
| 2494 if (Document* document = toLocalFrame(frame)->document()) | 2494 if (Document* document = toLocalFrame(frame)->document()) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 double WebViewImpl::setZoomLevel(double zoomLevel) | 2626 double WebViewImpl::setZoomLevel(double zoomLevel) |
| 2627 { | 2627 { |
| 2628 if (zoomLevel < m_minimumZoomLevel) | 2628 if (zoomLevel < m_minimumZoomLevel) |
| 2629 m_zoomLevel = m_minimumZoomLevel; | 2629 m_zoomLevel = m_minimumZoomLevel; |
| 2630 else if (zoomLevel > m_maximumZoomLevel) | 2630 else if (zoomLevel > m_maximumZoomLevel) |
| 2631 m_zoomLevel = m_maximumZoomLevel; | 2631 m_zoomLevel = m_maximumZoomLevel; |
| 2632 else | 2632 else |
| 2633 m_zoomLevel = zoomLevel; | 2633 m_zoomLevel = zoomLevel; |
| 2634 | 2634 |
| 2635 LocalFrame* frame = mainFrameImpl()->frame(); | 2635 LocalFrame* frame = mainFrameImpl()->frame(); |
| 2636 WebPluginContainerImpl* pluginContainer = WebFrameImpl::pluginContainerFromF
rame(frame); | 2636 WebPluginContainerImpl* pluginContainer = WebLocalFrameImpl::pluginContainer
FromFrame(frame); |
| 2637 if (pluginContainer) | 2637 if (pluginContainer) |
| 2638 pluginContainer->plugin()->setZoomLevel(m_zoomLevel, false); | 2638 pluginContainer->plugin()->setZoomLevel(m_zoomLevel, false); |
| 2639 else { | 2639 else { |
| 2640 float zoomFactor = m_zoomFactorOverride ? m_zoomFactorOverride : static_
cast<float>(zoomLevelToZoomFactor(m_zoomLevel)); | 2640 float zoomFactor = m_zoomFactorOverride ? m_zoomFactorOverride : static_
cast<float>(zoomLevelToZoomFactor(m_zoomLevel)); |
| 2641 frame->setPageZoomFactor(zoomFactor); | 2641 frame->setPageZoomFactor(zoomFactor); |
| 2642 } | 2642 } |
| 2643 | 2643 |
| 2644 return m_zoomLevel; | 2644 return m_zoomLevel; |
| 2645 } | 2645 } |
| 2646 | 2646 |
| 2647 void WebViewImpl::zoomLimitsChanged(double minimumZoomLevel, | 2647 void WebViewImpl::zoomLimitsChanged(double minimumZoomLevel, |
| 2648 double maximumZoomLevel) | 2648 double maximumZoomLevel) |
| 2649 { | 2649 { |
| 2650 m_minimumZoomLevel = minimumZoomLevel; | 2650 m_minimumZoomLevel = minimumZoomLevel; |
| 2651 m_maximumZoomLevel = maximumZoomLevel; | 2651 m_maximumZoomLevel = maximumZoomLevel; |
| 2652 m_client->zoomLimitsChanged(m_minimumZoomLevel, m_maximumZoomLevel); | 2652 m_client->zoomLimitsChanged(m_minimumZoomLevel, m_maximumZoomLevel); |
| 2653 } | 2653 } |
| 2654 | 2654 |
| 2655 float WebViewImpl::textZoomFactor() | 2655 float WebViewImpl::textZoomFactor() |
| 2656 { | 2656 { |
| 2657 return mainFrameImpl()->frame()->textZoomFactor(); | 2657 return mainFrameImpl()->frame()->textZoomFactor(); |
| 2658 } | 2658 } |
| 2659 | 2659 |
| 2660 float WebViewImpl::setTextZoomFactor(float textZoomFactor) | 2660 float WebViewImpl::setTextZoomFactor(float textZoomFactor) |
| 2661 { | 2661 { |
| 2662 LocalFrame* frame = mainFrameImpl()->frame(); | 2662 LocalFrame* frame = mainFrameImpl()->frame(); |
| 2663 if (WebFrameImpl::pluginContainerFromFrame(frame)) | 2663 if (WebLocalFrameImpl::pluginContainerFromFrame(frame)) |
| 2664 return 1; | 2664 return 1; |
| 2665 | 2665 |
| 2666 frame->setTextZoomFactor(textZoomFactor); | 2666 frame->setTextZoomFactor(textZoomFactor); |
| 2667 | 2667 |
| 2668 return textZoomFactor; | 2668 return textZoomFactor; |
| 2669 } | 2669 } |
| 2670 | 2670 |
| 2671 void WebViewImpl::fullFramePluginZoomLevelChanged(double zoomLevel) | 2671 void WebViewImpl::fullFramePluginZoomLevelChanged(double zoomLevel) |
| 2672 { | 2672 { |
| 2673 if (zoomLevel == m_zoomLevel) | 2673 if (zoomLevel == m_zoomLevel) |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3526 if (isNewNavigation && !isNavigationWithinPage) | 3526 if (isNewNavigation && !isNavigationWithinPage) |
| 3527 m_pageScaleConstraintsSet.setNeedsReset(true); | 3527 m_pageScaleConstraintsSet.setNeedsReset(true); |
| 3528 | 3528 |
| 3529 // Make sure link highlight from previous page is cleared. | 3529 // Make sure link highlight from previous page is cleared. |
| 3530 m_linkHighlights.clear(); | 3530 m_linkHighlights.clear(); |
| 3531 endActiveFlingAnimation(); | 3531 endActiveFlingAnimation(); |
| 3532 resetSavedScrollAndScaleState(); | 3532 resetSavedScrollAndScaleState(); |
| 3533 m_userGestureObserved = false; | 3533 m_userGestureObserved = false; |
| 3534 } | 3534 } |
| 3535 | 3535 |
| 3536 void WebViewImpl::willInsertBody(WebFrameImpl* webframe) | 3536 void WebViewImpl::willInsertBody(WebLocalFrameImpl* webframe) |
| 3537 { | 3537 { |
| 3538 if (webframe != mainFrameImpl()) | 3538 if (webframe != mainFrameImpl()) |
| 3539 return; | 3539 return; |
| 3540 | 3540 |
| 3541 // If we get to the <body> tag and we have no pending stylesheet and import
load, we | 3541 // If we get to the <body> tag and we have no pending stylesheet and import
load, we |
| 3542 // can be fairly confident we'll have something sensible to paint soon and | 3542 // can be fairly confident we'll have something sensible to paint soon and |
| 3543 // can turn off deferred commits. | 3543 // can turn off deferred commits. |
| 3544 if (m_page->mainFrame()->document()->isRenderingReady()) | 3544 if (m_page->mainFrame()->document()->isRenderingReady()) |
| 3545 resumeTreeViewCommits(); | 3545 resumeTreeViewCommits(); |
| 3546 } | 3546 } |
| 3547 | 3547 |
| 3548 void WebViewImpl::resumeTreeViewCommits() | 3548 void WebViewImpl::resumeTreeViewCommits() |
| 3549 { | 3549 { |
| 3550 if (m_layerTreeViewCommitsDeferred) { | 3550 if (m_layerTreeViewCommitsDeferred) { |
| 3551 if (m_layerTreeView) | 3551 if (m_layerTreeView) |
| 3552 m_layerTreeView->setDeferCommits(false); | 3552 m_layerTreeView->setDeferCommits(false); |
| 3553 m_layerTreeViewCommitsDeferred = false; | 3553 m_layerTreeViewCommitsDeferred = false; |
| 3554 } | 3554 } |
| 3555 } | 3555 } |
| 3556 | 3556 |
| 3557 void WebViewImpl::layoutUpdated(WebFrameImpl* webframe) | 3557 void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe) |
| 3558 { | 3558 { |
| 3559 if (!m_client || webframe != mainFrameImpl()) | 3559 if (!m_client || webframe != mainFrameImpl()) |
| 3560 return; | 3560 return; |
| 3561 | 3561 |
| 3562 // If we finished a layout while in deferred commit mode, | 3562 // If we finished a layout while in deferred commit mode, |
| 3563 // that means it's time to start producing frames again so un-defer. | 3563 // that means it's time to start producing frames again so un-defer. |
| 3564 resumeTreeViewCommits(); | 3564 resumeTreeViewCommits(); |
| 3565 | 3565 |
| 3566 if (m_shouldAutoResize && mainFrameImpl()->frame() && mainFrameImpl()->frame
()->view()) { | 3566 if (m_shouldAutoResize && mainFrameImpl()->frame() && mainFrameImpl()->frame
()->view()) { |
| 3567 WebSize frameSize = mainFrameImpl()->frame()->view()->frameRect().size()
; | 3567 WebSize frameSize = mainFrameImpl()->frame()->view()->frameRect().size()
; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3599 void WebViewImpl::startDragging(LocalFrame* frame, | 3599 void WebViewImpl::startDragging(LocalFrame* frame, |
| 3600 const WebDragData& dragData, | 3600 const WebDragData& dragData, |
| 3601 WebDragOperationsMask mask, | 3601 WebDragOperationsMask mask, |
| 3602 const WebImage& dragImage, | 3602 const WebImage& dragImage, |
| 3603 const WebPoint& dragImageOffset) | 3603 const WebPoint& dragImageOffset) |
| 3604 { | 3604 { |
| 3605 if (!m_client) | 3605 if (!m_client) |
| 3606 return; | 3606 return; |
| 3607 ASSERT(!m_doingDragAndDrop); | 3607 ASSERT(!m_doingDragAndDrop); |
| 3608 m_doingDragAndDrop = true; | 3608 m_doingDragAndDrop = true; |
| 3609 m_client->startDragging(WebFrameImpl::fromFrame(frame), dragData, mask, drag
Image, dragImageOffset); | 3609 m_client->startDragging(WebLocalFrameImpl::fromFrame(frame), dragData, mask,
dragImage, dragImageOffset); |
| 3610 } | 3610 } |
| 3611 | 3611 |
| 3612 void WebViewImpl::setIgnoreInputEvents(bool newValue) | 3612 void WebViewImpl::setIgnoreInputEvents(bool newValue) |
| 3613 { | 3613 { |
| 3614 ASSERT(m_ignoreInputEvents != newValue); | 3614 ASSERT(m_ignoreInputEvents != newValue); |
| 3615 m_ignoreInputEvents = newValue; | 3615 m_ignoreInputEvents = newValue; |
| 3616 } | 3616 } |
| 3617 | 3617 |
| 3618 void WebViewImpl::setBackgroundColorOverride(WebColor color) | 3618 void WebViewImpl::setBackgroundColorOverride(WebColor color) |
| 3619 { | 3619 { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4078 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4078 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4079 | 4079 |
| 4080 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4080 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4081 return false; | 4081 return false; |
| 4082 | 4082 |
| 4083 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4083 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4084 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4084 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4085 } | 4085 } |
| 4086 | 4086 |
| 4087 } // namespace blink | 4087 } // namespace blink |
| OLD | NEW |