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

Unified Diff: Source/core/frame/DOMWindow.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/dom/Document.cpp ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/DOMWindow.cpp
diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp
index 15a499eed8652e0d313279030c78d9f2f4ba5fc9..53b60ef7dea67c43e15c5054eae95668b55946a5 100644
--- a/Source/core/frame/DOMWindow.cpp
+++ b/Source/core/frame/DOMWindow.cpp
@@ -238,10 +238,7 @@ static bool allowsBeforeUnloadListeners(DOMWindow* window)
Frame* frame = window->frame();
if (!frame)
return false;
- Page* page = frame->page();
- if (!page)
- return false;
- return frame == page->mainFrame();
+ return frame->isMainFrame();
}
unsigned DOMWindow::pendingUnloadEventListeners() const
@@ -403,7 +400,7 @@ PassRefPtr<Document> DOMWindow::installNewDocument(const String& mimeType, const
m_frame->selection().updateSecureKeyboardEntryIfActive();
- if (m_frame->page() && m_frame->page()->mainFrame() == m_frame) {
+ if (m_frame->isMainFrame()) {
m_frame->page()->mainFrame()->notifyChromeClientWheelEventHandlerCountChanged();
if (m_document->hasTouchEventHandlers())
m_frame->page()->chrome().client().needTouchEvents(true);
@@ -943,7 +940,7 @@ void DOMWindow::focus(ExecutionContext* context)
}
// If we're a top level window, bring the window to the front.
- if (m_frame == page->mainFrame() && allowFocus)
+ if (m_frame->isMainFrame() && allowFocus)
page->chrome().focus();
if (!m_frame)
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698