OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All |
3 * Rights Reserved. | 3 * Rights Reserved. |
4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. | 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. |
5 * (http://www.torchmobile.com/) | 5 * (http://www.torchmobile.com/) |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 m_useCounter(pageClients.chromeClient && | 113 m_useCounter(pageClients.chromeClient && |
114 pageClients.chromeClient->isSVGImageChromeClient() | 114 pageClients.chromeClient->isSVGImageChromeClient() |
115 ? UseCounter::SVGImageContext | 115 ? UseCounter::SVGImageContext |
116 : UseCounter::DefaultContext), | 116 : UseCounter::DefaultContext), |
117 m_openedByDOM(false), | 117 m_openedByDOM(false), |
118 m_tabKeyCyclesThroughElements(true), | 118 m_tabKeyCyclesThroughElements(true), |
119 m_suspended(false), | 119 m_suspended(false), |
120 m_deviceScaleFactor(1), | 120 m_deviceScaleFactor(1), |
121 m_visibilityState(PageVisibilityStateVisible), | 121 m_visibilityState(PageVisibilityStateVisible), |
122 m_isCursorVisible(true), | 122 m_isCursorVisible(true), |
| 123 m_subframeCount(0), |
123 m_frameHost(FrameHost::create(*this)) { | 124 m_frameHost(FrameHost::create(*this)) { |
124 ASSERT(m_editorClient); | 125 ASSERT(m_editorClient); |
125 | 126 |
126 ASSERT(!allPages().contains(this)); | 127 ASSERT(!allPages().contains(this)); |
127 allPages().insert(this); | 128 allPages().insert(this); |
128 } | 129 } |
129 | 130 |
130 Page::~Page() { | 131 Page::~Page() { |
131 // willBeDestroyed() must be called before Page destruction. | 132 // willBeDestroyed() must be called before Page destruction. |
132 ASSERT(!m_mainFrame); | 133 ASSERT(!m_mainFrame); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 382 } |
382 | 383 |
383 bool Page::isPageVisible() const { | 384 bool Page::isPageVisible() const { |
384 return visibilityState() == PageVisibilityStateVisible; | 385 return visibilityState() == PageVisibilityStateVisible; |
385 } | 386 } |
386 | 387 |
387 bool Page::isCursorVisible() const { | 388 bool Page::isCursorVisible() const { |
388 return m_isCursorVisible; | 389 return m_isCursorVisible; |
389 } | 390 } |
390 | 391 |
| 392 #if DCHECK_IS_ON() |
| 393 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) { |
| 394 DCHECK_GE(expectedFrameCount, 0); |
| 395 |
| 396 int actualFrameCount = 0; |
| 397 for (; frame; frame = frame->tree().traverseNext()) |
| 398 ++actualFrameCount; |
| 399 |
| 400 DCHECK_EQ(expectedFrameCount, actualFrameCount); |
| 401 } |
| 402 #endif |
| 403 |
| 404 int Page::subframeCount() const { |
| 405 #if DCHECK_IS_ON() |
| 406 checkFrameCountConsistency(m_subframeCount + 1, mainFrame()); |
| 407 #endif |
| 408 return m_subframeCount; |
| 409 } |
| 410 |
391 void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { | 411 void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { |
392 switch (changeType) { | 412 switch (changeType) { |
393 case SettingsDelegate::StyleChange: | 413 case SettingsDelegate::StyleChange: |
394 setNeedsRecalcStyleInAllFrames(); | 414 setNeedsRecalcStyleInAllFrames(); |
395 break; | 415 break; |
396 case SettingsDelegate::ViewportDescriptionChange: | 416 case SettingsDelegate::ViewportDescriptionChange: |
397 if (mainFrame() && mainFrame()->isLocalFrame()) { | 417 if (mainFrame() && mainFrame()->isLocalFrame()) { |
398 deprecatedLocalMainFrame()->document()->updateViewportDescription(); | 418 deprecatedLocalMainFrame()->document()->updateViewportDescription(); |
399 // The text autosizer has dependencies on the viewport. | 419 // The text autosizer has dependencies on the viewport. |
400 if (TextAutosizer* textAutosizer = | 420 if (TextAutosizer* textAutosizer = |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 : chromeClient(nullptr), | 625 : chromeClient(nullptr), |
606 contextMenuClient(nullptr), | 626 contextMenuClient(nullptr), |
607 editorClient(nullptr), | 627 editorClient(nullptr), |
608 spellCheckerClient(nullptr) {} | 628 spellCheckerClient(nullptr) {} |
609 | 629 |
610 Page::PageClients::~PageClients() {} | 630 Page::PageClients::~PageClients() {} |
611 | 631 |
612 template class CORE_TEMPLATE_EXPORT Supplement<Page>; | 632 template class CORE_TEMPLATE_EXPORT Supplement<Page>; |
613 | 633 |
614 } // namespace blink | 634 } // namespace blink |
OLD | NEW |