Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Unified Diff: Source/core/frame/Frame.cpp

Issue 59573002: Add Frame::isMainFrame and deploy it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/Frame.cpp
diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp
index 252af456429d86e6e02f6078265e266bed4e548e..b533c9157e21119323bbea1fa63ae52c083c0971 100644
--- a/Source/core/frame/Frame.cpp
+++ b/Source/core/frame/Frame.cpp
@@ -204,7 +204,7 @@ void Frame::setView(PassRefPtr<FrameView> view)
m_view = view;
- if (m_view && m_page && m_page->mainFrame() == this)
+ if (m_view && isMainFrame())
m_view->setVisibleContentScaleFactor(m_page->pageScaleFactor());
}
@@ -358,6 +358,11 @@ void Frame::disconnectOwnerElement()
m_frameInit->setOwnerElement(0);
}
+bool Frame::isMainFrame() const
+{
+ return m_page && this == m_page->mainFrame();
+}
+
String Frame::documentTypeString() const
{
if (DocumentType* doctype = document()->doctype())
@@ -435,7 +440,7 @@ void Frame::createView(const IntSize& viewportSize, const Color& backgroundColor
ASSERT(this);
ASSERT(m_page);
- bool isMainFrame = this == m_page->mainFrame();
+ bool isMainFrame = this->isMainFrame();
if (isMainFrame && view())
view()->setParentVisible(false);
@@ -547,7 +552,7 @@ void Frame::deviceOrPageScaleFactorChanged()
void Frame::notifyChromeClientWheelEventHandlerCountChanged() const
{
// Ensure that this method is being called on the main frame of the page.
- ASSERT(m_page && m_page->mainFrame() == this);
+ ASSERT(isMainFrame());
unsigned count = 0;
for (const Frame* frame = this; frame; frame = frame->tree().traverseNext()) {
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698