OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 , m_totalMatchCount(-1) | 2107 , m_totalMatchCount(-1) |
2108 , m_framesScopingCount(-1) | 2108 , m_framesScopingCount(-1) |
2109 , m_findRequestIdentifier(-1) | 2109 , m_findRequestIdentifier(-1) |
2110 , m_scopingInProgress(false) | 2110 , m_scopingInProgress(false) |
2111 , m_lastFindRequestCompletedWithNoMatches(false) | 2111 , m_lastFindRequestCompletedWithNoMatches(false) |
2112 , m_nextInvalidateAfter(0) | 2112 , m_nextInvalidateAfter(0) |
2113 , m_findMatchMarkersVersion(0) | 2113 , m_findMatchMarkersVersion(0) |
2114 , m_findMatchRectsAreValid(false) | 2114 , m_findMatchRectsAreValid(false) |
2115 , m_embedderIdentifier(embedderIdentifier) | 2115 , m_embedderIdentifier(embedderIdentifier) |
2116 , m_inSameDocumentHistoryLoad(false) | 2116 , m_inSameDocumentHistoryLoad(false) |
| 2117 , m_inputEventsScaleFactorForEmulation(1) |
2117 { | 2118 { |
2118 WebKit::Platform::current()->incrementStatsCounter(webFrameActiveCount); | 2119 WebKit::Platform::current()->incrementStatsCounter(webFrameActiveCount); |
2119 frameCount++; | 2120 frameCount++; |
2120 } | 2121 } |
2121 | 2122 |
2122 WebFrameImpl::~WebFrameImpl() | 2123 WebFrameImpl::~WebFrameImpl() |
2123 { | 2124 { |
2124 WebKit::Platform::current()->decrementStatsCounter(webFrameActiveCount); | 2125 WebKit::Platform::current()->decrementStatsCounter(webFrameActiveCount); |
2125 frameCount--; | 2126 frameCount--; |
2126 | 2127 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2237 | 2238 |
2238 WebViewImpl* webView = viewImpl(); | 2239 WebViewImpl* webView = viewImpl(); |
2239 bool isMainFrame = webView->mainFrameImpl()->frame() == frame(); | 2240 bool isMainFrame = webView->mainFrameImpl()->frame() == frame(); |
2240 if (isMainFrame) | 2241 if (isMainFrame) |
2241 webView->suppressInvalidations(true); | 2242 webView->suppressInvalidations(true); |
2242 | 2243 |
2243 frame()->createView(webView->size(), webView->baseBackgroundColor(), webView
->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLay
outModeEnabled() : 0); | 2244 frame()->createView(webView->size(), webView->baseBackgroundColor(), webView
->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLay
outModeEnabled() : 0); |
2244 if (webView->shouldAutoResize() && isMainFrame) | 2245 if (webView->shouldAutoResize() && isMainFrame) |
2245 frame()->view()->enableAutoSizeMode(true, webView->minAutoSize(), webVie
w->maxAutoSize()); | 2246 frame()->view()->enableAutoSizeMode(true, webView->minAutoSize(), webVie
w->maxAutoSize()); |
2246 | 2247 |
| 2248 frame()->view()->setInputEventsScaleFactorForEmulation(m_inputEventsScaleFac
torForEmulation); |
| 2249 |
2247 if (isMainFrame) | 2250 if (isMainFrame) |
2248 webView->suppressInvalidations(false); | 2251 webView->suppressInvalidations(false); |
2249 | |
2250 if (isMainFrame && webView->devToolsAgentPrivate()) | |
2251 webView->devToolsAgentPrivate()->mainFrameViewCreated(this); | |
2252 } | 2252 } |
2253 | 2253 |
2254 WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame) | 2254 WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame) |
2255 { | 2255 { |
2256 if (!frame) | 2256 if (!frame) |
2257 return 0; | 2257 return 0; |
2258 return static_cast<FrameLoaderClientImpl*>(frame->loader()->client())->webFr
ame(); | 2258 return static_cast<FrameLoaderClientImpl*>(frame->loader()->client())->webFr
ame(); |
2259 } | 2259 } |
2260 | 2260 |
2261 WebFrameImpl* WebFrameImpl::fromFrameOwnerElement(Element* element) | 2261 WebFrameImpl* WebFrameImpl::fromFrameOwnerElement(Element* element) |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2356 client()->didFailProvisionalLoad(this, webError); | 2356 client()->didFailProvisionalLoad(this, webError); |
2357 else | 2357 else |
2358 client()->didFailLoad(this, webError); | 2358 client()->didFailLoad(this, webError); |
2359 } | 2359 } |
2360 | 2360 |
2361 void WebFrameImpl::setCanHaveScrollbars(bool canHaveScrollbars) | 2361 void WebFrameImpl::setCanHaveScrollbars(bool canHaveScrollbars) |
2362 { | 2362 { |
2363 frame()->view()->setCanHaveScrollbars(canHaveScrollbars); | 2363 frame()->view()->setCanHaveScrollbars(canHaveScrollbars); |
2364 } | 2364 } |
2365 | 2365 |
| 2366 void WebFrameImpl::setInputEventsScaleFactorForEmulation(float contentScaleFacto
r) |
| 2367 { |
| 2368 m_inputEventsScaleFactorForEmulation = contentScaleFactor; |
| 2369 if (frame()->view()) |
| 2370 frame()->view()->setInputEventsScaleFactorForEmulation(m_inputEventsScal
eFactorForEmulation); |
| 2371 } |
| 2372 |
2366 void WebFrameImpl::invalidateArea(AreaToInvalidate area) | 2373 void WebFrameImpl::invalidateArea(AreaToInvalidate area) |
2367 { | 2374 { |
2368 ASSERT(frame() && frame()->view()); | 2375 ASSERT(frame() && frame()->view()); |
2369 FrameView* view = frame()->view(); | 2376 FrameView* view = frame()->view(); |
2370 | 2377 |
2371 if ((area & InvalidateAll) == InvalidateAll) | 2378 if ((area & InvalidateAll) == InvalidateAll) |
2372 view->invalidateRect(view->frameRect()); | 2379 view->invalidateRect(view->frameRect()); |
2373 else { | 2380 else { |
2374 if ((area & InvalidateContentArea) == InvalidateContentArea) { | 2381 if ((area & InvalidateContentArea) == InvalidateContentArea) { |
2375 IntRect contentArea( | 2382 IntRect contentArea( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2514 | 2521 |
2515 // There is a possibility that the frame being detached was the only | 2522 // There is a possibility that the frame being detached was the only |
2516 // pending one. We need to make sure final replies can be sent. | 2523 // pending one. We need to make sure final replies can be sent. |
2517 flushCurrentScopingEffort(m_findRequestIdentifier); | 2524 flushCurrentScopingEffort(m_findRequestIdentifier); |
2518 | 2525 |
2519 cancelPendingScopingEffort(); | 2526 cancelPendingScopingEffort(); |
2520 } | 2527 } |
2521 } | 2528 } |
2522 | 2529 |
2523 } // namespace WebKit | 2530 } // namespace WebKit |
OLD | NEW |