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

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 15820002: Page::chrome() should return a reference. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 7 months 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/loader/FrameLoader.h ('k') | Source/core/page/BarProp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index fdfbea3a5d679248d85d1c27fada7223ffc72f39..41aa334a63f6077f745642c719c2273d76e26165 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -1041,7 +1041,7 @@ void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockBac
Frame* targetFrame = sourceFrame->loader()->findFrameForNavigation(request.frameName());
if (targetFrame && targetFrame != sourceFrame) {
if (Page* page = targetFrame->page())
- page->chrome()->focus();
+ page->chrome().focus();
}
}
@@ -1424,7 +1424,7 @@ void FrameLoader::transitionToCommitted()
setState(FrameStateCommittedPage);
if (isLoadingMainFrame())
- m_frame->page()->chrome()->client()->needTouchEvents(false);
+ m_frame->page()->chrome().client()->needTouchEvents(false);
history()->updateForCommit();
m_client->transitionToCommittedForNewPage();
@@ -2031,8 +2031,7 @@ void FrameLoader::scrollToFragmentWithParentBoundary(const KURL& url)
bool FrameLoader::shouldClose()
{
Page* page = m_frame->page();
- Chrome* chrome = page ? page->chrome() : 0;
- if (!chrome || !chrome->canRunBeforeUnloadConfirmPanel())
+ if (!page || !page->chrome().canRunBeforeUnloadConfirmPanel())
return true;
// Store all references to each subframe in advance since beforeunload's event handler may modify frame
@@ -2049,7 +2048,7 @@ bool FrameLoader::shouldClose()
for (i = 0; i < targetFrames.size(); i++) {
if (!targetFrames[i]->tree()->isDescendantOf(m_frame))
continue;
- if (!targetFrames[i]->loader()->fireBeforeUnloadEvent(chrome))
+ if (!targetFrames[i]->loader()->fireBeforeUnloadEvent(page->chrome()))
break;
}
@@ -2063,7 +2062,7 @@ bool FrameLoader::shouldClose()
return shouldClose;
}
-bool FrameLoader::fireBeforeUnloadEvent(Chrome* chrome)
+bool FrameLoader::fireBeforeUnloadEvent(Chrome& chrome)
{
DOMWindow* domWindow = m_frame->document()->domWindow();
if (!domWindow)
@@ -2084,7 +2083,7 @@ bool FrameLoader::fireBeforeUnloadEvent(Chrome* chrome)
return true;
String text = document->displayStringModifiedByEncoding(beforeUnloadEvent->result());
- return chrome->runBeforeUnloadConfirmPanel(text, m_frame);
+ return chrome.runBeforeUnloadConfirmPanel(text, m_frame);
}
void FrameLoader::checkNavigationPolicyAndContinueLoad(PassRefPtr<FormState> formState)
@@ -2565,7 +2564,7 @@ Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque
if (Frame* frame = lookupFrame->loader()->findFrameForNavigation(request.frameName(), openerFrame->document())) {
if (request.frameName() != "_self") {
if (Page* page = frame->page())
- page->chrome()->focus();
+ page->chrome().focus();
}
created = false;
return frame;
@@ -2596,7 +2595,7 @@ Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque
return 0;
NavigationAction action(requestWithReferrer.resourceRequest());
- Page* page = oldPage->chrome()->createWindow(openerFrame, requestWithReferrer, features, action);
+ Page* page = oldPage->chrome().createWindow(openerFrame, requestWithReferrer, features, action);
if (!page)
return 0;
@@ -2607,18 +2606,18 @@ Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque
if (request.frameName() != "_blank")
frame->tree()->setName(request.frameName());
- page->chrome()->setToolbarsVisible(features.toolBarVisible || features.locationBarVisible);
- page->chrome()->setStatusbarVisible(features.statusBarVisible);
- page->chrome()->setScrollbarsVisible(features.scrollbarsVisible);
- page->chrome()->setMenubarVisible(features.menuBarVisible);
- page->chrome()->setResizable(features.resizable);
+ page->chrome().setToolbarsVisible(features.toolBarVisible || features.locationBarVisible);
+ page->chrome().setStatusbarVisible(features.statusBarVisible);
+ page->chrome().setScrollbarsVisible(features.scrollbarsVisible);
+ page->chrome().setMenubarVisible(features.menuBarVisible);
+ page->chrome().setResizable(features.resizable);
// 'x' and 'y' specify the location of the window, while 'width' and 'height'
// specify the size of the viewport. We can only resize the window, so adjust
// for the difference between the window size and the viewport size.
- FloatRect windowRect = page->chrome()->windowRect();
- FloatSize viewportSize = page->chrome()->pageRect().size();
+ FloatRect windowRect = page->chrome().windowRect();
+ FloatSize viewportSize = page->chrome().pageRect().size();
if (features.xSet)
windowRect.setX(features.x);
@@ -2632,8 +2631,8 @@ Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque
// Ensure non-NaN values, minimum size as well as being within valid screen area.
FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect);
- page->chrome()->setWindowRect(newWindowRect);
- page->chrome()->show();
+ page->chrome().setWindowRect(newWindowRect);
+ page->chrome().show();
created = true;
return frame;
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | Source/core/page/BarProp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698