| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All |
| 3 * Rights Reserved. | 3 * Rights Reserved. |
| 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. | 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. |
| 5 * (http://www.torchmobile.com/) | 5 * (http://www.torchmobile.com/) |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "core/html/HTMLMediaElement.h" | 42 #include "core/html/HTMLMediaElement.h" |
| 43 #include "core/inspector/ConsoleMessageStorage.h" | 43 #include "core/inspector/ConsoleMessageStorage.h" |
| 44 #include "core/inspector/InspectorInstrumentation.h" | 44 #include "core/inspector/InspectorInstrumentation.h" |
| 45 #include "core/layout/TextAutosizer.h" | 45 #include "core/layout/TextAutosizer.h" |
| 46 #include "core/page/AutoscrollController.h" | 46 #include "core/page/AutoscrollController.h" |
| 47 #include "core/page/ChromeClient.h" | 47 #include "core/page/ChromeClient.h" |
| 48 #include "core/page/ContextMenuController.h" | 48 #include "core/page/ContextMenuController.h" |
| 49 #include "core/page/DragController.h" | 49 #include "core/page/DragController.h" |
| 50 #include "core/page/FocusController.h" | 50 #include "core/page/FocusController.h" |
| 51 #include "core/page/PointerLockController.h" | 51 #include "core/page/PointerLockController.h" |
| 52 #include "core/page/ScopedPageLoadDeferrer.h" | 52 #include "core/page/ScopedPageSuspender.h" |
| 53 #include "core/page/ValidationMessageClient.h" | 53 #include "core/page/ValidationMessageClient.h" |
| 54 #include "core/page/scrolling/ScrollingCoordinator.h" | 54 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 55 #include "core/paint/PaintLayer.h" | 55 #include "core/paint/PaintLayer.h" |
| 56 #include "platform/graphics/GraphicsLayer.h" | 56 #include "platform/graphics/GraphicsLayer.h" |
| 57 #include "platform/plugins/PluginData.h" | 57 #include "platform/plugins/PluginData.h" |
| 58 #include "public/platform/Platform.h" | 58 #include "public/platform/Platform.h" |
| 59 | 59 |
| 60 namespace blink { | 60 namespace blink { |
| 61 | 61 |
| 62 // Set of all live pages; includes internal Page objects that are | 62 // Set of all live pages; includes internal Page objects that are |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return 1; | 98 return 1; |
| 99 Page* page = frame->page(); | 99 Page* page = frame->page(); |
| 100 if (!page) | 100 if (!page) |
| 101 return 1; | 101 return 1; |
| 102 return page->deviceScaleFactor(); | 102 return page->deviceScaleFactor(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 Page* Page::createOrdinary(PageClients& pageClients) { | 105 Page* Page::createOrdinary(PageClients& pageClients) { |
| 106 Page* page = create(pageClients); | 106 Page* page = create(pageClients); |
| 107 ordinaryPages().add(page); | 107 ordinaryPages().add(page); |
| 108 if (ScopedPageLoadDeferrer::isActive()) | 108 if (ScopedPageSuspender::isActive()) |
| 109 page->setDefersLoading(true); | 109 page->setSuspended(true); |
| 110 return page; | 110 return page; |
| 111 } | 111 } |
| 112 | 112 |
| 113 Page::Page(PageClients& pageClients) | 113 Page::Page(PageClients& pageClients) |
| 114 : SettingsDelegate(Settings::create()), | 114 : SettingsDelegate(Settings::create()), |
| 115 m_animator(PageAnimator::create(*this)), | 115 m_animator(PageAnimator::create(*this)), |
| 116 m_autoscrollController(AutoscrollController::create(*this)), | 116 m_autoscrollController(AutoscrollController::create(*this)), |
| 117 m_chromeClient(pageClients.chromeClient), | 117 m_chromeClient(pageClients.chromeClient), |
| 118 m_dragCaretController(DragCaretController::create()), | 118 m_dragCaretController(DragCaretController::create()), |
| 119 m_dragController(DragController::create(this)), | 119 m_dragController(DragController::create(this)), |
| 120 m_focusController(FocusController::create(this)), | 120 m_focusController(FocusController::create(this)), |
| 121 m_contextMenuController( | 121 m_contextMenuController( |
| 122 ContextMenuController::create(this, pageClients.contextMenuClient)), | 122 ContextMenuController::create(this, pageClients.contextMenuClient)), |
| 123 m_pointerLockController(PointerLockController::create(this)), | 123 m_pointerLockController(PointerLockController::create(this)), |
| 124 m_mainFrame(nullptr), | 124 m_mainFrame(nullptr), |
| 125 m_editorClient(pageClients.editorClient), | 125 m_editorClient(pageClients.editorClient), |
| 126 m_spellCheckerClient(pageClients.spellCheckerClient), | 126 m_spellCheckerClient(pageClients.spellCheckerClient), |
| 127 m_useCounter(pageClients.chromeClient && | 127 m_useCounter(pageClients.chromeClient && |
| 128 pageClients.chromeClient->isSVGImageChromeClient() | 128 pageClients.chromeClient->isSVGImageChromeClient() |
| 129 ? UseCounter::SVGImageContext | 129 ? UseCounter::SVGImageContext |
| 130 : UseCounter::DefaultContext), | 130 : UseCounter::DefaultContext), |
| 131 m_openedByDOM(false), | 131 m_openedByDOM(false), |
| 132 m_tabKeyCyclesThroughElements(true), | 132 m_tabKeyCyclesThroughElements(true), |
| 133 m_defersLoading(false), | 133 m_suspended(false), |
| 134 m_deviceScaleFactor(1), | 134 m_deviceScaleFactor(1), |
| 135 m_visibilityState(PageVisibilityStateVisible), | 135 m_visibilityState(PageVisibilityStateVisible), |
| 136 m_isCursorVisible(true), | 136 m_isCursorVisible(true), |
| 137 #if ENABLE(ASSERT) | 137 #if ENABLE(ASSERT) |
| 138 m_isPainting(false), | 138 m_isPainting(false), |
| 139 #endif | 139 #endif |
| 140 m_frameHost(FrameHost::create(*this)) { | 140 m_frameHost(FrameHost::create(*this)) { |
| 141 ASSERT(m_editorClient); | 141 ASSERT(m_editorClient); |
| 142 | 142 |
| 143 ASSERT(!allPages().contains(this)); | 143 ASSERT(!allPages().contains(this)); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (!m_pluginData || | 246 if (!m_pluginData || |
| 247 !mainFrameOrigin->isSameSchemeHostPort(m_pluginData->origin())) | 247 !mainFrameOrigin->isSameSchemeHostPort(m_pluginData->origin())) |
| 248 m_pluginData = PluginData::create(mainFrameOrigin); | 248 m_pluginData = PluginData::create(mainFrameOrigin); |
| 249 return m_pluginData.get(); | 249 return m_pluginData.get(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void Page::setValidationMessageClient(ValidationMessageClient* client) { | 252 void Page::setValidationMessageClient(ValidationMessageClient* client) { |
| 253 m_validationMessageClient = client; | 253 m_validationMessageClient = client; |
| 254 } | 254 } |
| 255 | 255 |
| 256 void Page::setDefersLoading(bool defers) { | 256 void Page::setSuspended(bool suspend) { |
| 257 if (defers == m_defersLoading) | 257 if (suspend == m_suspended) |
| 258 return; | 258 return; |
| 259 | 259 |
| 260 m_defersLoading = defers; | 260 m_suspended = suspend; |
| 261 for (Frame* frame = mainFrame(); frame; | 261 for (Frame* frame = mainFrame(); frame; |
| 262 frame = frame->tree().traverseNext()) { | 262 frame = frame->tree().traverseNext()) { |
| 263 if (frame->isLocalFrame()) | 263 if (frame->isLocalFrame()) |
| 264 toLocalFrame(frame)->loader().setDefersLoading(defers); | 264 toLocalFrame(frame)->loader().setDefersLoading(suspend); |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 void Page::setPageScaleFactor(float scale) { | 268 void Page::setPageScaleFactor(float scale) { |
| 269 frameHost().visualViewport().setScale(scale); | 269 frameHost().visualViewport().setScale(scale); |
| 270 } | 270 } |
| 271 | 271 |
| 272 float Page::pageScaleFactor() const { | 272 float Page::pageScaleFactor() const { |
| 273 return frameHost().visualViewport().scale(); | 273 return frameHost().visualViewport().scale(); |
| 274 } | 274 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 : chromeClient(nullptr), | 535 : chromeClient(nullptr), |
| 536 contextMenuClient(nullptr), | 536 contextMenuClient(nullptr), |
| 537 editorClient(nullptr), | 537 editorClient(nullptr), |
| 538 spellCheckerClient(nullptr) {} | 538 spellCheckerClient(nullptr) {} |
| 539 | 539 |
| 540 Page::PageClients::~PageClients() {} | 540 Page::PageClients::~PageClients() {} |
| 541 | 541 |
| 542 template class CORE_TEMPLATE_EXPORT Supplement<Page>; | 542 template class CORE_TEMPLATE_EXPORT Supplement<Page>; |
| 543 | 543 |
| 544 } // namespace blink | 544 } // namespace blink |
| OLD | NEW |