| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "core/loader/FrameLoader.h" | 74 #include "core/loader/FrameLoader.h" |
| 75 #include "core/loader/FrameLoaderClient.h" | 75 #include "core/loader/FrameLoaderClient.h" |
| 76 #include "core/loader/FrameLoaderStateMachine.h" | 76 #include "core/loader/FrameLoaderStateMachine.h" |
| 77 #include "core/page/ContextMenuController.h" | 77 #include "core/page/ContextMenuController.h" |
| 78 #include "core/page/ContextMenuProvider.h" | 78 #include "core/page/ContextMenuProvider.h" |
| 79 #include "core/page/FocusController.h" | 79 #include "core/page/FocusController.h" |
| 80 #include "core/page/FrameTree.h" | 80 #include "core/page/FrameTree.h" |
| 81 #include "core/page/Page.h" | 81 #include "core/page/Page.h" |
| 82 #include "core/page/PagePopupClient.h" | 82 #include "core/page/PagePopupClient.h" |
| 83 #include "core/page/PointerLockController.h" | 83 #include "core/page/PointerLockController.h" |
| 84 #include "core/page/ScopedPageLoadDeferrer.h" | 84 #include "core/page/ScopedPageSuspender.h" |
| 85 #include "core/page/TouchDisambiguation.h" | 85 #include "core/page/TouchDisambiguation.h" |
| 86 #include "core/page/scrolling/TopDocumentRootScrollerController.h" | 86 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
| 87 #include "core/paint/PaintLayer.h" | 87 #include "core/paint/PaintLayer.h" |
| 88 #include "core/timing/DOMWindowPerformance.h" | 88 #include "core/timing/DOMWindowPerformance.h" |
| 89 #include "core/timing/Performance.h" | 89 #include "core/timing/Performance.h" |
| 90 #include "modules/accessibility/AXObject.h" | 90 #include "modules/accessibility/AXObject.h" |
| 91 #include "modules/accessibility/AXObjectCacheImpl.h" | 91 #include "modules/accessibility/AXObjectCacheImpl.h" |
| 92 #include "modules/credentialmanager/CredentialManagerClient.h" | 92 #include "modules/credentialmanager/CredentialManagerClient.h" |
| 93 #include "modules/encryptedmedia/MediaKeysController.h" | 93 #include "modules/encryptedmedia/MediaKeysController.h" |
| 94 #include "modules/storage/StorageNamespaceController.h" | 94 #include "modules/storage/StorageNamespaceController.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // zooms text in or out (ie., change by 20%). The min and max values limit | 221 // zooms text in or out (ie., change by 20%). The min and max values limit |
| 222 // text zoom to half and 3x the original text size. These three values match | 222 // text zoom to half and 3x the original text size. These three values match |
| 223 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm | 223 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm |
| 224 const double WebView::textSizeMultiplierRatio = 1.2; | 224 const double WebView::textSizeMultiplierRatio = 1.2; |
| 225 const double WebView::minTextSizeMultiplier = 0.5; | 225 const double WebView::minTextSizeMultiplier = 0.5; |
| 226 const double WebView::maxTextSizeMultiplier = 3.0; | 226 const double WebView::maxTextSizeMultiplier = 3.0; |
| 227 | 227 |
| 228 // Used to defer all page activity in cases where the embedder wishes to run | 228 // Used to defer all page activity in cases where the embedder wishes to run |
| 229 // a nested event loop. Using a stack enables nesting of message loop | 229 // a nested event loop. Using a stack enables nesting of message loop |
| 230 // invocations. | 230 // invocations. |
| 231 static Vector<std::unique_ptr<ScopedPageLoadDeferrer>>& | 231 static Vector<std::unique_ptr<ScopedPageSuspender>>& pageSuspenderStack() { |
| 232 pageLoadDeferrerStack() { | 232 DEFINE_STATIC_LOCAL(Vector<std::unique_ptr<ScopedPageSuspender>>, |
| 233 DEFINE_STATIC_LOCAL(Vector<std::unique_ptr<ScopedPageLoadDeferrer>>, | 233 suspenderStack, ()); |
| 234 deferrerStack, ()); | 234 return suspenderStack; |
| 235 return deferrerStack; | |
| 236 } | 235 } |
| 237 | 236 |
| 238 static bool shouldUseExternalPopupMenus = false; | 237 static bool shouldUseExternalPopupMenus = false; |
| 239 | 238 |
| 240 namespace { | 239 namespace { |
| 241 | 240 |
| 242 class EmptyEventListener final : public EventListener { | 241 class EmptyEventListener final : public EventListener { |
| 243 public: | 242 public: |
| 244 static EmptyEventListener* create() { return new EmptyEventListener(); } | 243 static EmptyEventListener* create() { return new EmptyEventListener(); } |
| 245 | 244 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 294 |
| 296 void WebView::updateVisitedLinkState(unsigned long long linkHash) { | 295 void WebView::updateVisitedLinkState(unsigned long long linkHash) { |
| 297 Page::visitedStateChanged(linkHash); | 296 Page::visitedStateChanged(linkHash); |
| 298 } | 297 } |
| 299 | 298 |
| 300 void WebView::resetVisitedLinkState(bool invalidateVisitedLinkHashes) { | 299 void WebView::resetVisitedLinkState(bool invalidateVisitedLinkHashes) { |
| 301 Page::allVisitedStateChanged(invalidateVisitedLinkHashes); | 300 Page::allVisitedStateChanged(invalidateVisitedLinkHashes); |
| 302 } | 301 } |
| 303 | 302 |
| 304 void WebView::willEnterModalLoop() { | 303 void WebView::willEnterModalLoop() { |
| 305 pageLoadDeferrerStack().append(makeUnique<ScopedPageLoadDeferrer>()); | 304 pageSuspenderStack().append(makeUnique<ScopedPageSuspender>()); |
| 306 } | 305 } |
| 307 | 306 |
| 308 void WebView::didExitModalLoop() { | 307 void WebView::didExitModalLoop() { |
| 309 DCHECK(pageLoadDeferrerStack().size()); | 308 DCHECK(pageSuspenderStack().size()); |
| 310 pageLoadDeferrerStack().pop_back(); | 309 pageSuspenderStack().pop_back(); |
| 311 } | 310 } |
| 312 | 311 |
| 313 void WebViewImpl::setMainFrame(WebFrame* frame) { | 312 void WebViewImpl::setMainFrame(WebFrame* frame) { |
| 314 frame->toImplBase()->initializeCoreFrame(&page()->frameHost(), 0, nullAtom, | 313 frame->toImplBase()->initializeCoreFrame(&page()->frameHost(), 0, nullAtom, |
| 315 nullAtom); | 314 nullAtom); |
| 316 } | 315 } |
| 317 | 316 |
| 318 void WebViewImpl::setCredentialManagerClient( | 317 void WebViewImpl::setCredentialManagerClient( |
| 319 WebCredentialManagerClient* webCredentialManagerClient) { | 318 WebCredentialManagerClient* webCredentialManagerClient) { |
| 320 DCHECK(m_page); | 319 DCHECK(m_page); |
| (...skipping 3875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4196 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4195 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4197 return nullptr; | 4196 return nullptr; |
| 4198 return focusedFrame; | 4197 return focusedFrame; |
| 4199 } | 4198 } |
| 4200 | 4199 |
| 4201 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4200 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4202 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4201 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4203 } | 4202 } |
| 4204 | 4203 |
| 4205 } // namespace blink | 4204 } // namespace blink |
| OLD | NEW |