| 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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #ifndef SKY_ENGINE_CORE_PAGE_PAGE_H_ | 21 #ifndef SKY_ENGINE_CORE_PAGE_PAGE_H_ |
| 22 #define SKY_ENGINE_CORE_PAGE_PAGE_H_ | 22 #define SKY_ENGINE_CORE_PAGE_PAGE_H_ |
| 23 | 23 |
| 24 #include "sky/engine/core/frame/ConsoleTypes.h" | 24 #include "sky/engine/core/frame/ConsoleTypes.h" |
| 25 #include "sky/engine/core/frame/LocalFrame.h" | 25 #include "sky/engine/core/frame/LocalFrame.h" |
| 26 #include "sky/engine/core/frame/SettingsDelegate.h" | 26 #include "sky/engine/core/frame/SettingsDelegate.h" |
| 27 #include "sky/engine/core/inspector/ConsoleAPITypes.h" | 27 #include "sky/engine/core/inspector/ConsoleAPITypes.h" |
| 28 #include "sky/engine/core/page/FocusType.h" | 28 #include "sky/engine/core/page/FocusType.h" |
| 29 #include "sky/engine/core/page/PageAnimator.h" | |
| 30 #include "sky/engine/core/page/PageVisibilityState.h" | |
| 31 #include "sky/engine/platform/HostWindow.h" | 29 #include "sky/engine/platform/HostWindow.h" |
| 32 #include "sky/engine/platform/LifecycleContext.h" | 30 #include "sky/engine/platform/LifecycleContext.h" |
| 33 #include "sky/engine/platform/Supplementable.h" | 31 #include "sky/engine/platform/Supplementable.h" |
| 34 #include "sky/engine/platform/geometry/LayoutRect.h" | 32 #include "sky/engine/platform/geometry/LayoutRect.h" |
| 35 #include "sky/engine/platform/geometry/Region.h" | 33 #include "sky/engine/platform/geometry/Region.h" |
| 36 #include "sky/engine/platform/heap/Handle.h" | 34 #include "sky/engine/platform/heap/Handle.h" |
| 37 #include "sky/engine/wtf/Forward.h" | 35 #include "sky/engine/wtf/Forward.h" |
| 38 #include "sky/engine/wtf/HashSet.h" | 36 #include "sky/engine/wtf/HashSet.h" |
| 39 #include "sky/engine/wtf/Noncopyable.h" | 37 #include "sky/engine/wtf/Noncopyable.h" |
| 40 #include "sky/engine/wtf/text/WTFString.h" | 38 #include "sky/engine/wtf/text/WTFString.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 90 |
| 93 EditorClient& editorClient() const { return *m_editorClient; } | 91 EditorClient& editorClient() const { return *m_editorClient; } |
| 94 SpellCheckerClient& spellCheckerClient() const { return *m_spellCheckerClien
t; } | 92 SpellCheckerClient& spellCheckerClient() const { return *m_spellCheckerClien
t; } |
| 95 UndoStack& undoStack() const { return *m_undoStack; } | 93 UndoStack& undoStack() const { return *m_undoStack; } |
| 96 | 94 |
| 97 void setMainFrame(LocalFrame*); | 95 void setMainFrame(LocalFrame*); |
| 98 LocalFrame* mainFrame() const { return m_mainFrame; } | 96 LocalFrame* mainFrame() const { return m_mainFrame; } |
| 99 | 97 |
| 100 void documentDetached(Document*); | 98 void documentDetached(Document*); |
| 101 | 99 |
| 102 PageAnimator& animator() { return m_animator; } | |
| 103 DragCaretController& dragCaretController() const { return *m_dragCaretContro
ller; } | 100 DragCaretController& dragCaretController() const { return *m_dragCaretContro
ller; } |
| 104 FocusController& focusController() const { return *m_focusController; } | 101 FocusController& focusController() const { return *m_focusController; } |
| 105 | 102 |
| 106 Settings& settings() const { return *m_settings; } | 103 Settings& settings() const { return *m_settings; } |
| 107 | 104 |
| 108 void unmarkAllTextMatches(); | 105 void unmarkAllTextMatches(); |
| 109 | 106 |
| 110 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 107 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
| 111 void setDeviceScaleFactor(float); | 108 void setDeviceScaleFactor(float); |
| 112 | 109 |
| 113 PageVisibilityState visibilityState() const; | |
| 114 void setVisibilityState(PageVisibilityState, bool); | |
| 115 | |
| 116 #if ENABLE(ASSERT) | 110 #if ENABLE(ASSERT) |
| 117 void setIsPainting(bool painting) { m_isPainting = painting; } | 111 void setIsPainting(bool painting) { m_isPainting = painting; } |
| 118 bool isPainting() const { return m_isPainting; } | 112 bool isPainting() const { return m_isPainting; } |
| 119 #endif | 113 #endif |
| 120 | 114 |
| 121 double timerAlignmentInterval() const; | 115 double timerAlignmentInterval() const; |
| 122 | 116 |
| 123 class MultisamplingChangedObserver { | 117 class MultisamplingChangedObserver { |
| 124 public: | 118 public: |
| 125 virtual void multisamplingChanged(bool) = 0; | 119 virtual void multisamplingChanged(bool) = 0; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 156 |
| 163 void initGroup(); | 157 void initGroup(); |
| 164 | 158 |
| 165 void setTimerAlignmentInterval(double); | 159 void setTimerAlignmentInterval(double); |
| 166 | 160 |
| 167 void setNeedsLayoutInAllFrames(); | 161 void setNeedsLayoutInAllFrames(); |
| 168 | 162 |
| 169 // SettingsDelegate overrides. | 163 // SettingsDelegate overrides. |
| 170 virtual void settingsChanged(SettingsDelegate::ChangeType) override; | 164 virtual void settingsChanged(SettingsDelegate::ChangeType) override; |
| 171 | 165 |
| 172 PageAnimator m_animator; | |
| 173 ChromeClient* m_chromeClient; | 166 ChromeClient* m_chromeClient; |
| 174 const OwnPtr<DragCaretController> m_dragCaretController; | 167 const OwnPtr<DragCaretController> m_dragCaretController; |
| 175 const OwnPtr<FocusController> m_focusController; | 168 const OwnPtr<FocusController> m_focusController; |
| 176 const OwnPtr<UndoStack> m_undoStack; | 169 const OwnPtr<UndoStack> m_undoStack; |
| 177 | 170 |
| 178 // Typically, the main frame and Page should both be owned by the embedder, | 171 // Typically, the main frame and Page should both be owned by the embedder, |
| 179 // which must call Page::willBeDestroyed() prior to destroying Page. This | 172 // which must call Page::willBeDestroyed() prior to destroying Page. This |
| 180 // call detaches the main frame and clears this pointer, thus ensuring that | 173 // call detaches the main frame and clears this pointer, thus ensuring that |
| 181 // this field only references a live main frame. | 174 // this field only references a live main frame. |
| 182 // | 175 // |
| 183 // However, there are several locations (InspectorOverlay) | 176 // However, there are several locations (InspectorOverlay) |
| 184 // which don't hold a reference to the main frame at all | 177 // which don't hold a reference to the main frame at all |
| 185 // after creating it. These are still safe because they always create a | 178 // after creating it. These are still safe because they always create a |
| 186 // Frame with a FrameView. FrameView and Frame hold references to each | 179 // Frame with a FrameView. FrameView and Frame hold references to each |
| 187 // other, thus keeping each other alive. The call to willBeDestroyed() | 180 // other, thus keeping each other alive. The call to willBeDestroyed() |
| 188 // breaks this cycle, so the frame is still properly destroyed once no | 181 // breaks this cycle, so the frame is still properly destroyed once no |
| 189 // longer needed. | 182 // longer needed. |
| 190 LocalFrame* m_mainFrame; | 183 LocalFrame* m_mainFrame; |
| 191 | 184 |
| 192 EditorClient* const m_editorClient; | 185 EditorClient* const m_editorClient; |
| 193 SpellCheckerClient* const m_spellCheckerClient; | 186 SpellCheckerClient* const m_spellCheckerClient; |
| 194 | 187 |
| 195 float m_deviceScaleFactor; | 188 float m_deviceScaleFactor; |
| 196 | 189 |
| 197 double m_timerAlignmentInterval; | 190 double m_timerAlignmentInterval; |
| 198 | 191 |
| 199 PageVisibilityState m_visibilityState; | |
| 200 | |
| 201 #if ENABLE(ASSERT) | 192 #if ENABLE(ASSERT) |
| 202 bool m_isPainting; | 193 bool m_isPainting; |
| 203 #endif | 194 #endif |
| 204 | 195 |
| 205 HashSet<RawPtr<MultisamplingChangedObserver> > m_multisamplingChangedObserve
rs; | 196 HashSet<RawPtr<MultisamplingChangedObserver> > m_multisamplingChangedObserve
rs; |
| 206 | 197 |
| 207 // A pointer to all the interfaces provided to in-process Frames for this Pa
ge. | 198 // A pointer to all the interfaces provided to in-process Frames for this Pa
ge. |
| 208 // FIXME: Most of the members of Page should move onto FrameHost. | 199 // FIXME: Most of the members of Page should move onto FrameHost. |
| 209 OwnPtr<FrameHost> m_frameHost; | 200 OwnPtr<FrameHost> m_frameHost; |
| 210 }; | 201 }; |
| 211 | 202 |
| 212 } // namespace blink | 203 } // namespace blink |
| 213 | 204 |
| 214 #endif // SKY_ENGINE_CORE_PAGE_PAGE_H_ | 205 #endif // SKY_ENGINE_CORE_PAGE_PAGE_H_ |
| OLD | NEW |