| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "platform/LifecycleContext.h" | 29 #include "platform/LifecycleContext.h" |
| 30 #include "platform/Supplementable.h" | 30 #include "platform/Supplementable.h" |
| 31 #include "platform/geometry/LayoutRect.h" | 31 #include "platform/geometry/LayoutRect.h" |
| 32 #include "platform/geometry/Region.h" | 32 #include "platform/geometry/Region.h" |
| 33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
| 34 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
| 35 #include "wtf/HashSet.h" | 35 #include "wtf/HashSet.h" |
| 36 #include "wtf/Noncopyable.h" | 36 #include "wtf/Noncopyable.h" |
| 37 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 38 | 38 |
| 39 // FIXME: Page should not need to know anything about InspectorHost. |
| 40 namespace inspector { |
| 41 class InspectorHost; |
| 42 } |
| 43 |
| 39 namespace blink { | 44 namespace blink { |
| 40 | 45 |
| 41 class AutoscrollController; | 46 class AutoscrollController; |
| 42 class Chrome; | 47 class Chrome; |
| 43 class ChromeClient; | 48 class ChromeClient; |
| 44 class ClientRectList; | 49 class ClientRectList; |
| 45 class Document; | 50 class Document; |
| 46 class DragCaretController; | 51 class DragCaretController; |
| 47 class EditorClient; | 52 class EditorClient; |
| 48 class FocusController; | 53 class FocusController; |
| 49 class Frame; | 54 class Frame; |
| 50 class FrameHost; | 55 class FrameHost; |
| 51 class PageLifecycleNotifier; | 56 class PageLifecycleNotifier; |
| 52 class PlatformMouseEvent; | 57 class PlatformMouseEvent; |
| 53 class Range; | 58 class Range; |
| 54 class RenderBox; | 59 class RenderBox; |
| 55 class RenderObject; | 60 class RenderObject; |
| 56 class VisibleSelection; | |
| 57 class ScrollableArea; | 61 class ScrollableArea; |
| 58 class ServiceProvider; | 62 class ServiceProvider; |
| 59 class Settings; | 63 class Settings; |
| 60 class SpellCheckerClient; | 64 class SpellCheckerClient; |
| 61 class UndoStack; | 65 class UndoStack; |
| 66 class VisibleSelection; |
| 62 | 67 |
| 63 typedef uint64_t LinkHash; | 68 typedef uint64_t LinkHash; |
| 64 | 69 |
| 65 float deviceScaleFactor(LocalFrame*); | 70 float deviceScaleFactor(LocalFrame*); |
| 66 | 71 |
| 67 class Page final : public Supplementable<Page>, public LifecycleContext<Page>, p
ublic SettingsDelegate { | 72 class Page final : public Supplementable<Page>, public LifecycleContext<Page>, p
ublic SettingsDelegate { |
| 68 WTF_MAKE_NONCOPYABLE(Page); | 73 WTF_MAKE_NONCOPYABLE(Page); |
| 69 friend class Settings; | 74 friend class Settings; |
| 70 public: | 75 public: |
| 71 static void scheduleForcedStyleRecalcForAllPages(); | |
| 72 | |
| 73 // It is up to the platform to ensure that non-null clients are provided whe
re required. | 76 // It is up to the platform to ensure that non-null clients are provided whe
re required. |
| 74 struct PageClients { | 77 struct PageClients { |
| 75 WTF_MAKE_NONCOPYABLE(PageClients); WTF_MAKE_FAST_ALLOCATED; | 78 WTF_MAKE_NONCOPYABLE(PageClients); WTF_MAKE_FAST_ALLOCATED; |
| 76 public: | 79 public: |
| 77 PageClients(); | 80 PageClients(); |
| 78 ~PageClients(); | 81 ~PageClients(); |
| 79 | 82 |
| 80 ChromeClient* chromeClient; | 83 ChromeClient* chromeClient; |
| 81 EditorClient* editorClient; | 84 EditorClient* editorClient; |
| 82 SpellCheckerClient* spellCheckerClient; | 85 SpellCheckerClient* spellCheckerClient; |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 Page(PageClients&, ServiceProvider&); | 88 Page(PageClients&, ServiceProvider&); |
| 86 virtual ~Page(); | 89 virtual ~Page(); |
| 87 | 90 |
| 88 void makeOrdinary(); | 91 FrameHost& frameHost() const { return *m_frameHost; } |
| 89 | 92 |
| 90 // This method returns all pages, incl. private ones associated with | 93 // FIXME(sky): This is only needed by PageDebuggerAgent to be able to look |
| 91 // inspector overlay, popups, SVGImage, etc. | 94 // up the InspectorHost from the frame associated with a v8 context. |
| 92 static HashSet<Page*>& allPages(); | 95 inspector::InspectorHost* inspectorHost() const { return m_inspectorHost; } |
| 93 // This method returns all ordinary pages. | 96 void setInspectorHost(inspector::InspectorHost* host) { m_inspectorHost = ho
st; } |
| 94 static HashSet<Page*>& ordinaryPages(); | |
| 95 | |
| 96 FrameHost& frameHost() const { return *m_frameHost; } | |
| 97 | 97 |
| 98 void setNeedsRecalcStyleInAllFrames(); | 98 void setNeedsRecalcStyleInAllFrames(); |
| 99 void updateAcceleratedCompositingSettings(); | 99 void updateAcceleratedCompositingSettings(); |
| 100 | 100 |
| 101 EditorClient& editorClient() const { return *m_editorClient; } | 101 EditorClient& editorClient() const { return *m_editorClient; } |
| 102 SpellCheckerClient& spellCheckerClient() const { return *m_spellCheckerClien
t; } | 102 SpellCheckerClient& spellCheckerClient() const { return *m_spellCheckerClien
t; } |
| 103 UndoStack& undoStack() const { return *m_undoStack; } | 103 UndoStack& undoStack() const { return *m_undoStack; } |
| 104 | 104 |
| 105 void setMainFrame(LocalFrame*); | 105 void setMainFrame(LocalFrame*); |
| 106 LocalFrame* mainFrame() const { return m_mainFrame; } | 106 LocalFrame* mainFrame() const { return m_mainFrame; } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 virtual void multisamplingChanged(bool) = 0; | 146 virtual void multisamplingChanged(bool) = 0; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 void addMultisamplingChangedObserver(MultisamplingChangedObserver*); | 149 void addMultisamplingChangedObserver(MultisamplingChangedObserver*); |
| 150 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*); | 150 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*); |
| 151 | 151 |
| 152 void didCommitLoad(LocalFrame*); | 152 void didCommitLoad(LocalFrame*); |
| 153 | 153 |
| 154 void acceptLanguagesChanged(); | 154 void acceptLanguagesChanged(); |
| 155 | 155 |
| 156 static void networkStateChanged(bool online); | |
| 157 PassOwnPtr<LifecycleNotifier<Page> > createLifecycleNotifier(); | 156 PassOwnPtr<LifecycleNotifier<Page> > createLifecycleNotifier(); |
| 158 | 157 |
| 159 void willBeDestroyed(); | 158 void willBeDestroyed(); |
| 160 | 159 |
| 161 protected: | 160 protected: |
| 162 PageLifecycleNotifier& lifecycleNotifier(); | 161 PageLifecycleNotifier& lifecycleNotifier(); |
| 163 | 162 |
| 164 private: | 163 private: |
| 165 void initGroup(); | 164 void initGroup(); |
| 166 | 165 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 210 |
| 212 #if ENABLE(ASSERT) | 211 #if ENABLE(ASSERT) |
| 213 bool m_isPainting; | 212 bool m_isPainting; |
| 214 #endif | 213 #endif |
| 215 | 214 |
| 216 HashSet<RawPtr<MultisamplingChangedObserver> > m_multisamplingChangedObserve
rs; | 215 HashSet<RawPtr<MultisamplingChangedObserver> > m_multisamplingChangedObserve
rs; |
| 217 | 216 |
| 218 // A pointer to all the interfaces provided to in-process Frames for this Pa
ge. | 217 // A pointer to all the interfaces provided to in-process Frames for this Pa
ge. |
| 219 // FIXME: Most of the members of Page should move onto FrameHost. | 218 // FIXME: Most of the members of Page should move onto FrameHost. |
| 220 OwnPtr<FrameHost> m_frameHost; | 219 OwnPtr<FrameHost> m_frameHost; |
| 220 inspector::InspectorHost* m_inspectorHost; |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace blink | 223 } // namespace blink |
| 224 | 224 |
| 225 #endif // Page_h | 225 #endif // Page_h |
| OLD | NEW |