| 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/LocalFrame.h" | 25 #include "sky/engine/core/frame/LocalFrame.h" |
| 25 #include "sky/engine/core/frame/SettingsDelegate.h" | 26 #include "sky/engine/core/frame/SettingsDelegate.h" |
| 27 #include "sky/engine/core/inspector/ConsoleAPITypes.h" |
| 28 #include "sky/engine/core/page/FocusType.h" |
| 26 #include "sky/engine/core/page/PageAnimator.h" | 29 #include "sky/engine/core/page/PageAnimator.h" |
| 27 #include "sky/engine/core/page/PageVisibilityState.h" | 30 #include "sky/engine/core/page/PageVisibilityState.h" |
| 31 #include "sky/engine/platform/Cursor.h" |
| 32 #include "sky/engine/platform/HostWindow.h" |
| 28 #include "sky/engine/platform/LifecycleContext.h" | 33 #include "sky/engine/platform/LifecycleContext.h" |
| 29 #include "sky/engine/platform/Supplementable.h" | 34 #include "sky/engine/platform/Supplementable.h" |
| 30 #include "sky/engine/platform/geometry/LayoutRect.h" | 35 #include "sky/engine/platform/geometry/LayoutRect.h" |
| 31 #include "sky/engine/platform/geometry/Region.h" | 36 #include "sky/engine/platform/geometry/Region.h" |
| 32 #include "sky/engine/platform/heap/Handle.h" | 37 #include "sky/engine/platform/heap/Handle.h" |
| 33 #include "sky/engine/wtf/Forward.h" | 38 #include "sky/engine/wtf/Forward.h" |
| 34 #include "sky/engine/wtf/HashSet.h" | 39 #include "sky/engine/wtf/HashSet.h" |
| 35 #include "sky/engine/wtf/Noncopyable.h" | 40 #include "sky/engine/wtf/Noncopyable.h" |
| 36 #include "sky/engine/wtf/text/WTFString.h" | 41 #include "sky/engine/wtf/text/WTFString.h" |
| 37 | 42 |
| 38 namespace blink { | 43 namespace blink { |
| 39 | 44 |
| 40 class AutoscrollController; | 45 class AutoscrollController; |
| 41 class Chrome; | |
| 42 class ChromeClient; | 46 class ChromeClient; |
| 43 class ClientRectList; | 47 class ClientRectList; |
| 44 class Document; | 48 class Document; |
| 45 class DragCaretController; | 49 class DragCaretController; |
| 46 class EditorClient; | 50 class EditorClient; |
| 51 class FloatRect; |
| 47 class FocusController; | 52 class FocusController; |
| 48 class Frame; | 53 class Frame; |
| 49 class FrameHost; | 54 class FrameHost; |
| 55 class IntRect; |
| 56 class LocalFrame; |
| 57 class Node; |
| 50 class PageLifecycleNotifier; | 58 class PageLifecycleNotifier; |
| 51 class Range; | 59 class Range; |
| 52 class RenderBox; | 60 class RenderBox; |
| 53 class RenderObject; | 61 class RenderObject; |
| 54 class ScrollableArea; | 62 class ScrollableArea; |
| 55 class ServiceProvider; | 63 class ServiceProvider; |
| 56 class Settings; | 64 class Settings; |
| 57 class SpellCheckerClient; | 65 class SpellCheckerClient; |
| 58 class UndoStack; | 66 class UndoStack; |
| 59 class VisibleSelection; | 67 class VisibleSelection; |
| 60 | 68 |
| 61 typedef uint64_t LinkHash; | 69 typedef uint64_t LinkHash; |
| 62 | 70 |
| 63 float deviceScaleFactor(LocalFrame*); | 71 float deviceScaleFactor(LocalFrame*); |
| 64 | 72 |
| 65 class Page final : public Supplementable<Page>, public LifecycleContext<Page>, p
ublic SettingsDelegate { | 73 class Page final : public Supplementable<Page>, public LifecycleContext<Page>, p
ublic SettingsDelegate, public HostWindow { |
| 66 WTF_MAKE_NONCOPYABLE(Page); | 74 WTF_MAKE_NONCOPYABLE(Page); |
| 67 friend class Settings; | 75 friend class Settings; |
| 68 public: | 76 public: |
| 69 // It is up to the platform to ensure that non-null clients are provided whe
re required. | 77 // It is up to the platform to ensure that non-null clients are provided whe
re required. |
| 70 struct PageClients { | 78 struct PageClients { |
| 71 WTF_MAKE_NONCOPYABLE(PageClients); WTF_MAKE_FAST_ALLOCATED; | 79 WTF_MAKE_NONCOPYABLE(PageClients); WTF_MAKE_FAST_ALLOCATED; |
| 72 public: | 80 public: |
| 73 PageClients(); | 81 PageClients(); |
| 74 ~PageClients(); | 82 ~PageClients(); |
| 75 | 83 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 88 EditorClient& editorClient() const { return *m_editorClient; } | 96 EditorClient& editorClient() const { return *m_editorClient; } |
| 89 SpellCheckerClient& spellCheckerClient() const { return *m_spellCheckerClien
t; } | 97 SpellCheckerClient& spellCheckerClient() const { return *m_spellCheckerClien
t; } |
| 90 UndoStack& undoStack() const { return *m_undoStack; } | 98 UndoStack& undoStack() const { return *m_undoStack; } |
| 91 | 99 |
| 92 void setMainFrame(LocalFrame*); | 100 void setMainFrame(LocalFrame*); |
| 93 LocalFrame* mainFrame() const { return m_mainFrame; } | 101 LocalFrame* mainFrame() const { return m_mainFrame; } |
| 94 | 102 |
| 95 void documentDetached(Document*); | 103 void documentDetached(Document*); |
| 96 | 104 |
| 97 PageAnimator& animator() { return m_animator; } | 105 PageAnimator& animator() { return m_animator; } |
| 98 Chrome& chrome() const { return *m_chrome; } | |
| 99 AutoscrollController& autoscrollController() const { return *m_autoscrollCon
troller; } | 106 AutoscrollController& autoscrollController() const { return *m_autoscrollCon
troller; } |
| 100 DragCaretController& dragCaretController() const { return *m_dragCaretContro
ller; } | 107 DragCaretController& dragCaretController() const { return *m_dragCaretContro
ller; } |
| 101 FocusController& focusController() const { return *m_focusController; } | 108 FocusController& focusController() const { return *m_focusController; } |
| 102 | 109 |
| 103 Settings& settings() const { return *m_settings; } | 110 Settings& settings() const { return *m_settings; } |
| 104 | 111 |
| 105 void unmarkAllTextMatches(); | 112 void unmarkAllTextMatches(); |
| 106 | 113 |
| 107 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 114 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
| 108 void setDeviceScaleFactor(float); | 115 void setDeviceScaleFactor(float); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 129 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*); | 136 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*); |
| 130 | 137 |
| 131 void didCommitLoad(LocalFrame*); | 138 void didCommitLoad(LocalFrame*); |
| 132 | 139 |
| 133 void acceptLanguagesChanged(); | 140 void acceptLanguagesChanged(); |
| 134 | 141 |
| 135 PassOwnPtr<LifecycleNotifier<Page> > createLifecycleNotifier(); | 142 PassOwnPtr<LifecycleNotifier<Page> > createLifecycleNotifier(); |
| 136 | 143 |
| 137 void willBeDestroyed(); | 144 void willBeDestroyed(); |
| 138 | 145 |
| 139 protected: | 146 // HostWindow methods. |
| 147 virtual IntRect rootViewToScreen(const IntRect&) const override; |
| 148 virtual blink::WebScreenInfo screenInfo() const override; |
| 149 virtual void scheduleVisualUpdate() override; |
| 150 |
| 151 void setWindowRect(const FloatRect&) const; |
| 152 FloatRect windowRect() const; |
| 153 |
| 154 void focus() const; |
| 155 |
| 156 bool canTakeFocus(FocusType) const; |
| 157 void takeFocus(FocusType) const; |
| 158 |
| 159 void focusedNodeChanged(Node*) const; |
| 160 void focusedFrameChanged(LocalFrame*) const; |
| 161 |
| 162 bool shouldReportDetailedMessageForSource(const String& source); |
| 163 void addMessageToConsole(LocalFrame*, MessageSource, MessageLevel, const Str
ing& message, unsigned lineNumber, const String& sourceID, const String& stackTr
ace); |
| 164 |
| 165 void setCursor(const Cursor&); |
| 166 |
| 167 void* webView() const; |
| 168 |
| 169 private: |
| 140 PageLifecycleNotifier& lifecycleNotifier(); | 170 PageLifecycleNotifier& lifecycleNotifier(); |
| 141 | 171 |
| 142 private: | |
| 143 void initGroup(); | 172 void initGroup(); |
| 144 | 173 |
| 145 void setTimerAlignmentInterval(double); | 174 void setTimerAlignmentInterval(double); |
| 146 | 175 |
| 147 void setNeedsLayoutInAllFrames(); | 176 void setNeedsLayoutInAllFrames(); |
| 148 | 177 |
| 149 // SettingsDelegate overrides. | 178 // SettingsDelegate overrides. |
| 150 virtual void settingsChanged(SettingsDelegate::ChangeType) override; | 179 virtual void settingsChanged(SettingsDelegate::ChangeType) override; |
| 151 | 180 |
| 152 PageAnimator m_animator; | 181 PageAnimator m_animator; |
| 153 const OwnPtr<AutoscrollController> m_autoscrollController; | 182 const OwnPtr<AutoscrollController> m_autoscrollController; |
| 154 const OwnPtr<Chrome> m_chrome; | 183 ChromeClient* m_chromeClient; |
| 155 const OwnPtr<DragCaretController> m_dragCaretController; | 184 const OwnPtr<DragCaretController> m_dragCaretController; |
| 156 const OwnPtr<FocusController> m_focusController; | 185 const OwnPtr<FocusController> m_focusController; |
| 157 const OwnPtr<UndoStack> m_undoStack; | 186 const OwnPtr<UndoStack> m_undoStack; |
| 158 | 187 |
| 159 // Typically, the main frame and Page should both be owned by the embedder, | 188 // Typically, the main frame and Page should both be owned by the embedder, |
| 160 // which must call Page::willBeDestroyed() prior to destroying Page. This | 189 // which must call Page::willBeDestroyed() prior to destroying Page. This |
| 161 // call detaches the main frame and clears this pointer, thus ensuring that | 190 // call detaches the main frame and clears this pointer, thus ensuring that |
| 162 // this field only references a live main frame. | 191 // this field only references a live main frame. |
| 163 // | 192 // |
| 164 // However, there are several locations (InspectorOverlay) | 193 // However, there are several locations (InspectorOverlay) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 188 HashSet<RawPtr<MultisamplingChangedObserver> > m_multisamplingChangedObserve
rs; | 217 HashSet<RawPtr<MultisamplingChangedObserver> > m_multisamplingChangedObserve
rs; |
| 189 | 218 |
| 190 // A pointer to all the interfaces provided to in-process Frames for this Pa
ge. | 219 // A pointer to all the interfaces provided to in-process Frames for this Pa
ge. |
| 191 // FIXME: Most of the members of Page should move onto FrameHost. | 220 // FIXME: Most of the members of Page should move onto FrameHost. |
| 192 OwnPtr<FrameHost> m_frameHost; | 221 OwnPtr<FrameHost> m_frameHost; |
| 193 }; | 222 }; |
| 194 | 223 |
| 195 } // namespace blink | 224 } // namespace blink |
| 196 | 225 |
| 197 #endif // SKY_ENGINE_CORE_PAGE_PAGE_H_ | 226 #endif // SKY_ENGINE_CORE_PAGE_PAGE_H_ |
| OLD | NEW |