153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)/*
253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) *
553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * This library is free software; you can redistribute it and/or
653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * modify it under the terms of the GNU Library General Public
753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * License as published by the Free Software Foundation; either
853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * version 2 of the License, or (at your option) any later version.
953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) *
1053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * This library is distributed in the hope that it will be useful,
1153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * but WITHOUT ANY WARRANTY; without even the implied warranty of
1253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Library General Public License for more details.
1453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) *
1553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * You should have received a copy of the GNU Library General Public License
1653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * along with this library; see the file COPYING.LIB.  If not, write to
1753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
1853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Boston, MA 02110-1301, USA.
1953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) */
2053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
2153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#ifndef Page_h
2253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#define Page_h
2353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
241e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "core/dom/ViewportDescription.h"
255d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)#include "core/frame/LocalFrame.h"
2609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "core/frame/SettingsDelegate.h"
2751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)#include "core/frame/UseCounter.h"
28d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)#include "core/page/PageAnimator.h"
2909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "core/page/PageVisibilityState.h"
30f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)#include "platform/LifecycleContext.h"
311e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "platform/Supplementable.h"
321e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "platform/geometry/LayoutRect.h"
331e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "platform/geometry/Region.h"
34f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu#include "platform/heap/Handle.h"
35591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch#include "wtf/Forward.h"
36591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch#include "wtf/HashSet.h"
37591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch#include "wtf/Noncopyable.h"
38591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch#include "wtf/text/WTFString.h"
3953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
40c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink {
4153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
425267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)class AutoscrollController;
4353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class BackForwardClient;
4453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class Chrome;
4553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class ChromeClient;
4653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class ClientRectList;
4753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class ContextMenuClient;
4853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class ContextMenuController;
4953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class Document;
5053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class DragCaretController;
5153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class DragClient;
5253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class DragController;
5353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class EditorClient;
5453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class FocusController;
555d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)class Frame;
5609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class FrameHost;
5753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class InspectorClient;
5853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class InspectorController;
590019e4eead4d990e4304c54a9028aca9122fb256Ben Murdochclass PageLifecycleNotifier;
6053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class PluginData;
6153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class PointerLockController;
6209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class StorageClient;
6353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class ScrollingCoordinator;
6453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class Settings;
6551b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)class SpellCheckerClient;
6653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class StorageNamespace;
6751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)class UndoStack;
6853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class ValidationMessageClient;
6953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
7053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)typedef uint64_t LinkHash;
7153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
72d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)float deviceScaleFactor(LocalFrame*);
7353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
74f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liuclass Page FINAL : public NoBaseWillBeGarbageCollectedFinalized<Page>, public WillBeHeapSupplementable<Page>, public LifecycleContext<Page>, public SettingsDelegate {
75f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Page);
7653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    WTF_MAKE_NONCOPYABLE(Page);
7753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    friend class Settings;
7853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
7953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    static void scheduleForcedStyleRecalcForAllPages();
8053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    // It is up to the platform to ensure that non-null clients are provided where required.
8253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    struct PageClients {
8353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        WTF_MAKE_NONCOPYABLE(PageClients); WTF_MAKE_FAST_ALLOCATED;
8453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    public:
8553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        PageClients();
8653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        ~PageClients();
8753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        ChromeClient* chromeClient;
8953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        ContextMenuClient* contextMenuClient;
9053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        EditorClient* editorClient;
9153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        DragClient* dragClient;
9253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        InspectorClient* inspectorClient;
9353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)        BackForwardClient* backForwardClient;
9451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)        SpellCheckerClient* spellCheckerClient;
9509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)        StorageClient* storageClient;
9653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    };
9753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
9853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    explicit Page(PageClients&);
9909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual ~Page();
10009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
101d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    void makeOrdinary();
102d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
10309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // This method returns all pages, incl. private ones associated with
10409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // inspector overlay, popups, SVGImage, etc.
10509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    static HashSet<Page*>& allPages();
106d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    // This method returns all ordinary pages.
107d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    static HashSet<Page*>& ordinaryPages();
10809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
10910f88d5669dbd969c059d61ba09fa37dd72ac559Ben Murdoch    FrameHost& frameHost() const { return *m_frameHost; }
11053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
11153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setNeedsRecalcStyleInAllFrames();
1126f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    void updateAcceleratedCompositingSettings();
11353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
1141e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    ViewportDescription viewportDescription() const;
11553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
11653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    static void refreshPlugins(bool reload);
11753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    PluginData* pluginData() const;
11853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
119e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    EditorClient& editorClient() const { return *m_editorClient; }
12051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    SpellCheckerClient& spellCheckerClient() const { return *m_spellCheckerClient; }
12151b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    UndoStack& undoStack() const { return *m_undoStack; }
12251b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
12376c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    void setMainFrame(Frame*);
12476c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    Frame* mainFrame() const { return m_mainFrame; }
1255d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    // Escape hatch for existing code that assumes that the root frame is
1265d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    // always a LocalFrame. With OOPI, this is not always the case. Code that
1275d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    // depends on this will generally have to be rewritten to propagate any
1285d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    // necessary state through all renderer processes for that page and/or
1295d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    // coordinate/rely on the browser process to help dispatch/coordinate work.
13076c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    LocalFrame* deprecatedLocalMainFrame() const { return toLocalFrame(m_mainFrame); }
13153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
132e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    void documentDetached(Document*);
133e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)
13453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool openedByDOM() const;
13553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setOpenedByDOM();
13653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
13753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void incrementSubframeCount() { ++m_subframeCount; }
13853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount; }
13953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    int subframeCount() const { checkSubframeCountConsistency(); return m_subframeCount; }
14053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
141697ef0c10ac944be8499480c025020e4c282c980Ben Murdoch    PageAnimator& animator() { return *m_animator; }
14293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    Chrome& chrome() const { return *m_chrome; }
14319cde67944066db31e633d9e386f2aa9bf9fadb3Torne (Richard Coles)    AutoscrollController& autoscrollController() const { return *m_autoscrollController; }
14400d3faa021f1e9934a353eeebe4e57e354856cf6Ben Murdoch    DragCaretController& dragCaretController() const { return *m_dragCaretController; }
14500d3faa021f1e9934a353eeebe4e57e354856cf6Ben Murdoch    DragController& dragController() const { return *m_dragController; }
1463c9e4aeaee9f9b0a9a814da07bcb33319c7ea363Ben Murdoch    FocusController& focusController() const { return *m_focusController; }
147e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    ContextMenuController& contextMenuController() const { return *m_contextMenuController; }
148e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    InspectorController& inspectorController() const { return *m_inspectorController; }
149e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    PointerLockController& pointerLockController() const { return *m_pointerLockController; }
150a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    ValidationMessageClient& validationMessageClient() const { return *m_validationMessageClient; }
1515d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    void setValidationMessageClient(PassOwnPtrWillBeRawPtr<ValidationMessageClient>);
15253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
15353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    ScrollingCoordinator* scrollingCoordinator();
15453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
15553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    String mainThreadScrollingReasonsAsText();
156a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    PassRefPtrWillBeRawPtr<ClientRectList> nonFastScrollableRects(const LocalFrame*);
15753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
158e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    Settings& settings() const { return *m_settings; }
159bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BackForwardClient& backForward() const { return *m_backForwardClient; }
16053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
161e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    UseCounter& useCounter() { return m_useCounter; }
16253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
16353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
16453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
16553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
16653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void unmarkAllTextMatches();
16753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
16809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // DefersLoading is used to delay loads during modal dialogs.
16909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // Modal dialogs are supposed to freeze all background processes
17009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // in the page, including prevent additional loads from staring/continuing.
17153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setDefersLoading(bool);
17253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool defersLoading() const { return m_defersLoading; }
17353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
17453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setPageScaleFactor(float scale, const IntPoint& origin);
17510f88d5669dbd969c059d61ba09fa37dd72ac559Ben Murdoch    float pageScaleFactor() const;
17653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
17753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    float deviceScaleFactor() const { return m_deviceScaleFactor; }
17853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setDeviceScaleFactor(float);
1797242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    void setDeviceColorProfile(const Vector<char>&);
1807242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    void resetDeviceColorProfile();
18153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
18209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    static void allVisitedStateChanged();
18309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    static void visitedStateChanged(LinkHash visitedHash);
18453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
18553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    StorageNamespace* sessionStorage(bool optionalCreate = true);
18609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    StorageClient& storageClient() const { return *m_storageClient; }
18753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
18853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    // Don't allow more than a certain number of frames in a page.
18953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    // This seems like a reasonable upper bound, and otherwise mutually
19053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    // recursive frameset pages can quickly bring the program to its knees
19153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    // with exponential growth in the number of frames.
19253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    static const int maxNumberOfFrames = 1000;
19353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
19453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    PageVisibilityState visibilityState() const;
19553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setVisibilityState(PageVisibilityState, bool);
19653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
19710f88d5669dbd969c059d61ba09fa37dd72ac559Ben Murdoch    bool isCursorVisible() const;
19853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setIsCursorVisible(bool isVisible) { m_isCursorVisible = isVisible; }
19953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
200197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#if ENABLE(ASSERT)
20153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setIsPainting(bool painting) { m_isPainting = painting; }
20253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool isPainting() const { return m_isPainting; }
20353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#endif
20453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
20553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    double timerAlignmentInterval() const;
20653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
207f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu    class MultisamplingChangedObserver : public WillBeGarbageCollectedMixin {
208e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)    public:
209e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)        virtual void multisamplingChanged(bool) = 0;
210e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)    };
211e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)
212e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)    void addMultisamplingChangedObserver(MultisamplingChangedObserver*);
213e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)    void removeMultisamplingChangedObserver(MultisamplingChangedObserver*);
214e52495584422c5edb5b2944981473a2e208da323Torne (Richard Coles)
215d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    void didCommitLoad(LocalFrame*);
21683750176c3ee2cea66c8a9751271026a5901be3aBen Murdoch
217f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles)    void acceptLanguagesChanged();
218f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles)
2191e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    static void networkStateChanged(bool online);
220f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PassOwnPtr<LifecycleNotifier<Page> > createLifecycleNotifier();
2211e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)
2226f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    void trace(Visitor*);
2236f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    void willBeDestroyed();
2246f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch
2250019e4eead4d990e4304c54a9028aca9122fb256Ben Murdochprotected:
226f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PageLifecycleNotifier& lifecycleNotifier();
2270019e4eead4d990e4304c54a9028aca9122fb256Ben Murdoch
22853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)private:
22953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void initGroup();
23053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
231197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#if ENABLE(ASSERT)
23253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void checkSubframeCountConsistency() const;
2335d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)#else
2345d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    void checkSubframeCountConsistency() const { }
23553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#endif
23653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
23753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    void setTimerAlignmentInterval(double);
23853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
23909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    void setNeedsLayoutInAllFrames();
24009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
24109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // SettingsDelegate overrides.
24209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual void settingsChanged(SettingsDelegate::ChangeType) OVERRIDE;
24309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
244697ef0c10ac944be8499480c025020e4c282c980Ben Murdoch    RefPtrWillBeMember<PageAnimator> m_animator;
245e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    const OwnPtr<AutoscrollController> m_autoscrollController;
246e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    const OwnPtr<Chrome> m_chrome;
247f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles)    const OwnPtrWillBeMember<DragCaretController> m_dragCaretController;
248d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles)    const OwnPtrWillBeMember<DragController> m_dragController;
2497242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    const OwnPtrWillBeMember<FocusController> m_focusController;
2505d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    const OwnPtrWillBeMember<ContextMenuController> m_contextMenuController;
251c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)    const OwnPtrWillBeMember<InspectorController> m_inspectorController;
2525d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    const OwnPtrWillBeMember<PointerLockController> m_pointerLockController;
25309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    OwnPtr<ScrollingCoordinator> m_scrollingCoordinator;
2545d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    const OwnPtrWillBeMember<UndoStack> m_undoStack;
25553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
25676c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // Typically, the main frame and Page should both be owned by the embedder,
25776c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // which must call Page::willBeDestroyed() prior to destroying Page. This
25876c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // call detaches the main frame and clears this pointer, thus ensuring that
25976c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // this field only references a live main frame.
26076c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    //
26176c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // However, there are several locations (InspectorOverlay, SVGImage, and
26276c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // WebPagePopupImpl) which don't hold a reference to the main frame at all
26376c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // after creating it. These are still safe because they always create a
26476c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // Frame with a FrameView. FrameView and Frame hold references to each
26576c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // other, thus keeping each other alive. The call to willBeDestroyed()
26676c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // breaks this cycle, so the frame is still properly destroyed once no
26776c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    // longer needed.
2687242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    RawPtrWillBeMember<Frame> m_mainFrame;
26953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
27053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    mutable RefPtr<PluginData> m_pluginData;
27153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
272bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BackForwardClient* m_backForwardClient;
273e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    EditorClient* const m_editorClient;
27451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    SpellCheckerClient* const m_spellCheckerClient;
27509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    StorageClient* m_storageClient;
2765d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    OwnPtrWillBeMember<ValidationMessageClient> m_validationMessageClient;
27753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
278e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    UseCounter m_useCounter;
27953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
28053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    int m_subframeCount;
28153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool m_openedByDOM;
28253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
28353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool m_tabKeyCyclesThroughElements;
28453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool m_defersLoading;
28553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
28653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    float m_deviceScaleFactor;
28753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
288591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch    OwnPtr<StorageNamespace> m_sessionStorage;
28953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
29053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    double m_timerAlignmentInterval;
29153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
29253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    PageVisibilityState m_visibilityState;
29353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
29453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool m_isCursorVisible;
29553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
296197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#if ENABLE(ASSERT)
29753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    bool m_isPainting;
29853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#endif
29953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
300f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu    WillBeHeapHashSet<RawPtrWillBeWeakMember<MultisamplingChangedObserver> > m_multisamplingChangedObservers;
30109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
30209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // A pointer to all the interfaces provided to in-process Frames for this Page.
30309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // FIXME: Most of the members of Page should move onto FrameHost.
304323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles)    OwnPtrWillBeMember<FrameHost> m_frameHost;
30553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
30653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
307c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink
30802772c6a72f1ee0b226341a4f4439970c29fc861Ben Murdoch
30953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#endif // Page_h
310