| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 m_useCounter(pageClients.chromeClient && | 121 m_useCounter(pageClients.chromeClient && |
| 122 pageClients.chromeClient->isSVGImageChromeClient() | 122 pageClients.chromeClient->isSVGImageChromeClient() |
| 123 ? UseCounter::SVGImageContext | 123 ? UseCounter::SVGImageContext |
| 124 : UseCounter::DefaultContext), | 124 : UseCounter::DefaultContext), |
| 125 m_openedByDOM(false), | 125 m_openedByDOM(false), |
| 126 m_tabKeyCyclesThroughElements(true), | 126 m_tabKeyCyclesThroughElements(true), |
| 127 m_suspended(false), | 127 m_suspended(false), |
| 128 m_deviceScaleFactor(1), | 128 m_deviceScaleFactor(1), |
| 129 m_visibilityState(PageVisibilityStateVisible), | 129 m_visibilityState(PageVisibilityStateVisible), |
| 130 m_isCursorVisible(true), | 130 m_isCursorVisible(true), |
| 131 m_subframeCount(0), |
| 131 m_frameHost(FrameHost::create(*this)) { | 132 m_frameHost(FrameHost::create(*this)) { |
| 132 ASSERT(m_editorClient); | 133 ASSERT(m_editorClient); |
| 133 | 134 |
| 134 ASSERT(!allPages().contains(this)); | 135 ASSERT(!allPages().contains(this)); |
| 135 allPages().insert(this); | 136 allPages().insert(this); |
| 136 } | 137 } |
| 137 | 138 |
| 138 Page::~Page() { | 139 Page::~Page() { |
| 139 // willBeDestroyed() must be called before Page destruction. | 140 // willBeDestroyed() must be called before Page destruction. |
| 140 ASSERT(!m_mainFrame); | 141 ASSERT(!m_mainFrame); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 418 } |
| 418 | 419 |
| 419 bool Page::isPageVisible() const { | 420 bool Page::isPageVisible() const { |
| 420 return visibilityState() == PageVisibilityStateVisible; | 421 return visibilityState() == PageVisibilityStateVisible; |
| 421 } | 422 } |
| 422 | 423 |
| 423 bool Page::isCursorVisible() const { | 424 bool Page::isCursorVisible() const { |
| 424 return m_isCursorVisible; | 425 return m_isCursorVisible; |
| 425 } | 426 } |
| 426 | 427 |
| 428 #if DCHECK_IS_ON() |
| 429 void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) { |
| 430 DCHECK_GE(expectedFrameCount, 0); |
| 431 |
| 432 int actualFrameCount = 0; |
| 433 for (; frame; frame = frame->tree().traverseNext()) |
| 434 ++actualFrameCount; |
| 435 |
| 436 DCHECK_EQ(expectedFrameCount, actualFrameCount); |
| 437 } |
| 438 #endif |
| 439 |
| 440 int Page::subframeCount() const { |
| 441 #if DCHECK_IS_ON() |
| 442 checkFrameCountConsistency(m_subframeCount + 1, mainFrame()); |
| 443 #endif |
| 444 return m_subframeCount; |
| 445 } |
| 446 |
| 427 void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { | 447 void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { |
| 428 switch (changeType) { | 448 switch (changeType) { |
| 429 case SettingsDelegate::StyleChange: | 449 case SettingsDelegate::StyleChange: |
| 430 setNeedsRecalcStyleInAllFrames(); | 450 setNeedsRecalcStyleInAllFrames(); |
| 431 break; | 451 break; |
| 432 case SettingsDelegate::ViewportDescriptionChange: | 452 case SettingsDelegate::ViewportDescriptionChange: |
| 433 if (mainFrame() && mainFrame()->isLocalFrame()) { | 453 if (mainFrame() && mainFrame()->isLocalFrame()) { |
| 434 deprecatedLocalMainFrame()->document()->updateViewportDescription(); | 454 deprecatedLocalMainFrame()->document()->updateViewportDescription(); |
| 435 // The text autosizer has dependencies on the viewport. | 455 // The text autosizer has dependencies on the viewport. |
| 436 if (TextAutosizer* textAutosizer = | 456 if (TextAutosizer* textAutosizer = |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 : chromeClient(nullptr), | 664 : chromeClient(nullptr), |
| 645 contextMenuClient(nullptr), | 665 contextMenuClient(nullptr), |
| 646 editorClient(nullptr), | 666 editorClient(nullptr), |
| 647 spellCheckerClient(nullptr) {} | 667 spellCheckerClient(nullptr) {} |
| 648 | 668 |
| 649 Page::PageClients::~PageClients() {} | 669 Page::PageClients::~PageClients() {} |
| 650 | 670 |
| 651 template class CORE_TEMPLATE_EXPORT Supplement<Page>; | 671 template class CORE_TEMPLATE_EXPORT Supplement<Page>; |
| 652 | 672 |
| 653 } // namespace blink | 673 } // namespace blink |
| OLD | NEW |