| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. |
| 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 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 if (!frame) | 55 if (!frame) |
| 56 return 1; | 56 return 1; |
| 57 Page* page = frame->page(); | 57 Page* page = frame->page(); |
| 58 if (!page) | 58 if (!page) |
| 59 return 1; | 59 return 1; |
| 60 return page->deviceScaleFactor(); | 60 return page->deviceScaleFactor(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 Page::Page(PageClients& pageClients, ServiceProvider* services) | 63 Page::Page(PageClients& pageClients, ServiceProvider* services) |
| 64 : SettingsDelegate(Settings::create()) | 64 : SettingsDelegate(Settings::create()) |
| 65 , m_animator(this) | |
| 66 , m_chromeClient(pageClients.chromeClient) | 65 , m_chromeClient(pageClients.chromeClient) |
| 67 , m_dragCaretController(DragCaretController::create()) | 66 , m_dragCaretController(DragCaretController::create()) |
| 68 , m_focusController(FocusController::create(this)) | 67 , m_focusController(FocusController::create(this)) |
| 69 , m_undoStack(UndoStack::create()) | 68 , m_undoStack(UndoStack::create()) |
| 70 , m_mainFrame(0) | 69 , m_mainFrame(0) |
| 71 , m_editorClient(pageClients.editorClient) | 70 , m_editorClient(pageClients.editorClient) |
| 72 , m_spellCheckerClient(pageClients.spellCheckerClient) | 71 , m_spellCheckerClient(pageClients.spellCheckerClient) |
| 73 , m_deviceScaleFactor(1) | 72 , m_deviceScaleFactor(1) |
| 74 , m_timerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval()) | 73 , m_timerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval()) |
| 75 , m_visibilityState(PageVisibilityStateVisible) | |
| 76 #if ENABLE(ASSERT) | 74 #if ENABLE(ASSERT) |
| 77 , m_isPainting(false) | 75 , m_isPainting(false) |
| 78 #endif | 76 #endif |
| 79 , m_frameHost(FrameHost::create(*this, services)) | 77 , m_frameHost(FrameHost::create(*this, services)) |
| 80 { | 78 { |
| 81 ASSERT(m_editorClient); | 79 ASSERT(m_editorClient); |
| 82 | 80 |
| 83 #ifndef NDEBUG | 81 #ifndef NDEBUG |
| 84 pageCounter.increment(); | 82 pageCounter.increment(); |
| 85 #endif | 83 #endif |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 LocalFrame* frame = mainFrame(); | 149 LocalFrame* frame = mainFrame(); |
| 152 if (frame->document()) | 150 if (frame->document()) |
| 153 frame->document()->didChangeTimerAlignmentInterval(); | 151 frame->document()->didChangeTimerAlignmentInterval(); |
| 154 } | 152 } |
| 155 | 153 |
| 156 double Page::timerAlignmentInterval() const | 154 double Page::timerAlignmentInterval() const |
| 157 { | 155 { |
| 158 return m_timerAlignmentInterval; | 156 return m_timerAlignmentInterval; |
| 159 } | 157 } |
| 160 | 158 |
| 161 void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia
lState) | |
| 162 { | |
| 163 if (m_visibilityState == visibilityState) | |
| 164 return; | |
| 165 m_visibilityState = visibilityState; | |
| 166 | |
| 167 if (visibilityState == blink::PageVisibilityStateVisible) | |
| 168 setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval()); | |
| 169 else | |
| 170 setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval()); | |
| 171 | |
| 172 if (!isInitialState) | |
| 173 lifecycleNotifier().notifyPageVisibilityChanged(); | |
| 174 | |
| 175 if (!isInitialState && m_mainFrame) | |
| 176 mainFrame()->didChangeVisibilityState(); | |
| 177 } | |
| 178 | |
| 179 PageVisibilityState Page::visibilityState() const | |
| 180 { | |
| 181 return m_visibilityState; | |
| 182 } | |
| 183 | |
| 184 void Page::addMultisamplingChangedObserver(MultisamplingChangedObserver* observe
r) | 159 void Page::addMultisamplingChangedObserver(MultisamplingChangedObserver* observe
r) |
| 185 { | 160 { |
| 186 m_multisamplingChangedObservers.add(observer); | 161 m_multisamplingChangedObservers.add(observer); |
| 187 } | 162 } |
| 188 | 163 |
| 189 void Page::removeMultisamplingChangedObserver(MultisamplingChangedObserver* obse
rver) | 164 void Page::removeMultisamplingChangedObserver(MultisamplingChangedObserver* obse
rver) |
| 190 { | 165 { |
| 191 m_multisamplingChangedObservers.remove(observer); | 166 m_multisamplingChangedObservers.remove(observer); |
| 192 } | 167 } |
| 193 | 168 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 , editorClient(0) | 303 , editorClient(0) |
| 329 , spellCheckerClient(0) | 304 , spellCheckerClient(0) |
| 330 { | 305 { |
| 331 } | 306 } |
| 332 | 307 |
| 333 Page::PageClients::~PageClients() | 308 Page::PageClients::~PageClients() |
| 334 { | 309 { |
| 335 } | 310 } |
| 336 | 311 |
| 337 } // namespace blink | 312 } // namespace blink |
| OLD | NEW |