Commit bd774814 authored by akling@apple.com's avatar akling@apple.com

Page::chrome() should return a reference.

<http://webkit.org/b/116185>

Source/WebCore:

Reviewed by Anders Carlsson.

A Page's chrome() can never be null. Change Page::chrome() to return a reference to reflect this.
Also, make Page::m_chrome a const member variable so nobody will accidentally set it to null.

Source/WebKit/blackberry:

Reviewed by Anders Carlsson.

Source/WebKit/efl:

Reviewed by Anders Carlsson.

Source/WebKit/gtk:

Reviewed by Anders Carlsson.

Source/WebKit/mac:

Reviewed by Anders Carlsson.

Source/WebKit/qt:

Reviewed by Anders Carlsson.

Source/WebKit/win:

Reviewed by Anders Carlsson.

Source/WebKit2:

Reviewed by Anders Carlsson.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6c21fd5d
2013-05-16 Andreas Kling <akling@apple.com>
Page::chrome() should return a reference.
<http://webkit.org/b/116185>
Reviewed by Anders Carlsson.
A Page's chrome() can never be null. Change Page::chrome() to return a reference to reflect this.
Also, make Page::m_chrome a const member variable so nobody will accidentally set it to null.
2013-05-16 Simon Fraser <simon.fraser@apple.com>
Content disappears when scrolling http://www.childrenscancer.org/zach/
......
......@@ -220,7 +220,7 @@ void DatabaseContext::databaseExceededQuota(const String& name, DatabaseDetails
if (m_scriptExecutionContext->isDocument()) {
Document* document = toDocument(m_scriptExecutionContext);
if (Page* page = document->page())
page->chrome()->client()->exceededDatabaseQuota(document->frame(), name, details);
page->chrome().client()->exceededDatabaseQuota(document->frame(), name, details);
return;
}
ASSERT(m_scriptExecutionContext->isWorkerContext());
......
......@@ -1522,12 +1522,12 @@ static NSMutableArray* convertToNSArray(const AccessibilityObject::Accessibility
// If we have an empty chrome client (like SVG) then we should use the page
// of the scroll view parent to help us get to the screen rect.
if (parent && page && page->chrome()->client()->isEmptyChromeClient())
if (parent && page && page->chrome().client()->isEmptyChromeClient())
page = parent->page();
if (page) {
IntRect rect = IntRect(intPoint, IntSize(0, 0));
intPoint = page->chrome()->rootViewToScreen(rect).location();
intPoint = page->chrome().rootViewToScreen(rect).location();
}
return intPoint;
......
......@@ -69,7 +69,7 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
return;
Page* page = document->page();
if (!page || !page->chrome()->platformPageClient())
if (!page || !page->chrome().platformPageClient())
return;
DWORD msaaEvent;
......@@ -104,7 +104,7 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
ASSERT(obj->axObjectID() >= 1);
ASSERT(obj->axObjectID() <= numeric_limits<LONG>::max());
NotifyWinEvent(msaaEvent, page->chrome()->platformPageClient(), OBJID_CLIENT, -static_cast<LONG>(obj->axObjectID()));
NotifyWinEvent(msaaEvent, page->chrome().platformPageClient(), OBJID_CLIENT, -static_cast<LONG>(obj->axObjectID()));
}
void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&)
......@@ -140,7 +140,7 @@ void AXObjectCache::handleFocusedUIElementChanged(Node*, Node* newFocusedNode)
return;
Page* page = newFocusedNode->document()->page();
if (!page || !page->chrome()->platformPageClient())
if (!page || !page->chrome().platformPageClient())
return;
AccessibilityObject* focusedObject = focusedUIElementForPage(page);
......
......@@ -151,7 +151,7 @@ bool JSDOMWindowBase::shouldInterruptScript(const JSGlobalObject* object)
if (!page)
return true;
return page->chrome()->shouldInterruptJavaScript();
return page->chrome().shouldInterruptJavaScript();
}
bool JSDOMWindowBase::javaScriptExperimentsEnabled(const JSGlobalObject* object)
......
......@@ -201,7 +201,7 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
#endif
if (!plugInsStyleSheet && (element->hasTagName(objectTag) || element->hasTagName(embedTag))) {
String plugInsRules = RenderTheme::themeForPage(element->document()->page())->extraPlugInsStyleSheet() + element->document()->page()->chrome()->client()->plugInExtraStyleSheet();
String plugInsRules = RenderTheme::themeForPage(element->document()->page())->extraPlugInsStyleSheet() + element->document()->page()->chrome().client()->plugInExtraStyleSheet();
if (plugInsRules.isEmpty())
plugInsRules = String(plugInsUserAgentStyleSheet, sizeof(plugInsUserAgentStyleSheet));
plugInsStyleSheet = parseUASheet(plugInsRules);
......
......@@ -999,7 +999,7 @@ void ContainerNode::setActive(bool down, bool pause)
// The rest of this function implements a feature that only works if the
// platform supports immediate invalidations on the ChromeClient, so bail if
// that isn't supported.
if (!document()->page()->chrome()->client()->supportsImmediateInvalidation())
if (!document()->page()->chrome().client()->supportsImmediateInvalidation())
return;
if (reactsToPress && pause) {
......
......@@ -2975,7 +2975,7 @@ void Document::updateViewportArguments()
#ifndef NDEBUG
m_didDispatchViewportPropertiesChanged = true;
#endif
page()->chrome()->dispatchViewportPropertiesDidChange(m_viewportArguments);
page()->chrome().dispatchViewportPropertiesDidChange(m_viewportArguments);
}
}
......@@ -3438,7 +3438,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> prpNewFocusedNode, FocusDirection
}
if (!focusChangeBlocked)
page()->chrome()->focusedNodeChanged(m_focusedNode.get());
page()->chrome().focusedNodeChanged(m_focusedNode.get());
SetFocusedNodeDone:
updateStyleIfNeeded();
......@@ -5036,12 +5036,12 @@ void Document::requestFullScreenForElement(Element* element, unsigned short flag
if (!page() || !page()->settings()->fullScreenEnabled())
break;
if (!page()->chrome()->client()->supportsFullScreenForElement(element, flags & Element::ALLOW_KEYBOARD_INPUT)) {
if (!page()->chrome().client()->supportsFullScreenForElement(element, flags & Element::ALLOW_KEYBOARD_INPUT)) {
// The new full screen API does not accept a "flags" parameter, so fall back to disallowing
// keyboard input if the chrome client refuses to allow keyboard input.
if (!inLegacyMozillaMode && flags & Element::ALLOW_KEYBOARD_INPUT) {
flags &= ~Element::ALLOW_KEYBOARD_INPUT;
if (!page()->chrome()->client()->supportsFullScreenForElement(element, false))
if (!page()->chrome().client()->supportsFullScreenForElement(element, false))
break;
} else
break;
......@@ -5096,7 +5096,7 @@ void Document::requestFullScreenForElement(Element* element, unsigned short flag
// 5. Return, and run the remaining steps asynchronously.
// 6. Optionally, perform some animation.
m_areKeysEnabledInFullScreen = flags & Element::ALLOW_KEYBOARD_INPUT;
page()->chrome()->client()->enterFullScreenForElement(element);
page()->chrome().client()->enterFullScreenForElement(element);
// 7. Optionally, display a message indicating how the user can exit displaying the context object fullscreen.
return;
......@@ -5187,12 +5187,12 @@ void Document::webkitExitFullscreen()
// Only exit out of full screen window mode if there are no remaining elements in the
// full screen stack.
if (!newTop) {
page()->chrome()->client()->exitFullScreenForElement(m_fullScreenElement.get());
page()->chrome().client()->exitFullScreenForElement(m_fullScreenElement.get());
return;
}
// Otherwise, notify the chrome of the new full screen element.
page()->chrome()->client()->enterFullScreenForElement(newTop);
page()->chrome().client()->enterFullScreenForElement(newTop);
}
bool Document::webkitFullscreenEnabled() const
......@@ -5317,7 +5317,7 @@ void Document::setFullScreenRenderer(RenderFullScreen* renderer)
// This notification can come in after the page has been destroyed.
if (page())
page()->chrome()->client()->fullScreenRendererChanged(m_fullScreenRenderer);
page()->chrome().client()->fullScreenRendererChanged(m_fullScreenRenderer);
}
void Document::fullScreenRendererDestroyed()
......@@ -5325,7 +5325,7 @@ void Document::fullScreenRendererDestroyed()
m_fullScreenRenderer = 0;
if (page())
page()->chrome()->client()->fullScreenRendererChanged(0);
page()->chrome().client()->fullScreenRendererChanged(0);
}
void Document::setFullScreenRendererSize(const IntSize& size)
......@@ -5635,7 +5635,7 @@ void Document::didAddTouchEventHandler(Node* handler)
scrollingCoordinator->touchEventTargetRectsDidChange(this);
#endif
if (m_touchEventTargets->size() == 1)
page->chrome()->client()->needTouchEvents(true);
page->chrome().client()->needTouchEvents(true);
}
#else
UNUSED_PARAM(handler);
......@@ -5667,7 +5667,7 @@ void Document::didRemoveTouchEventHandler(Node* handler)
if (frame->document() && frame->document()->hasTouchEventHandlers())
return;
}
page->chrome()->client()->needTouchEvents(false);
page->chrome().client()->needTouchEvents(false);
#else
UNUSED_PARAM(handler);
#endif
......@@ -6021,7 +6021,7 @@ PassRefPtr<FontLoader> Document::fontloader()
void Document::didAssociateFormControl(Element* element)
{
if (!frame() || !frame()->page() || !frame()->page()->chrome()->client()->shouldNotifyOnFormChanges())
if (!frame() || !frame()->page() || !frame()->page()->chrome().client()->shouldNotifyOnFormChanges())
return;
m_associatedFormControls.add(element);
if (!m_didAssociateFormControlsTimer.isActive())
......@@ -6037,7 +6037,7 @@ void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer)
Vector<RefPtr<Element> > associatedFormControls;
copyToVector(m_associatedFormControls, associatedFormControls);
frame()->page()->chrome()->client()->didAssociateFormControls(associatedFormControls);
frame()->page()->chrome().client()->didAssociateFormControls(associatedFormControls);
m_associatedFormControls.clear();
}
......@@ -6047,7 +6047,7 @@ void Document::ensurePlugInsInjectedScript(DOMWrapperWorld* world)
return;
// Use the JS file provided by the Chrome client, or fallback to the default one.
String jsString = page()->chrome()->client()->plugInExtraScript();
String jsString = page()->chrome().client()->plugInExtraScript();
if (!jsString)
jsString = plugInsJavaScript;
......
......@@ -2485,7 +2485,7 @@ bool Node::dispatchWheelEvent(const PlatformWheelEvent& event)
void Node::dispatchFocusEvent(PassRefPtr<Node> oldFocusedNode, FocusDirection)
{
if (document()->page())
document()->page()->chrome()->client()->elementDidFocus(this);
document()->page()->chrome().client()->elementDidFocus(this);
RefPtr<FocusEvent> event = FocusEvent::create(eventNames().focusEvent, false, false, document()->defaultView(), 0, oldFocusedNode);
EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(event.release()));
......@@ -2494,7 +2494,7 @@ void Node::dispatchFocusEvent(PassRefPtr<Node> oldFocusedNode, FocusDirection)
void Node::dispatchBlurEvent(PassRefPtr<Node> newFocusedNode)
{
if (document()->page())
document()->page()->chrome()->client()->elementDidBlur(this);
document()->page()->chrome().client()->elementDidBlur(this);
RefPtr<FocusEvent> event = FocusEvent::create(eventNames().blurEvent, false, false, document()->defaultView(), 0, newFocusedNode);
EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(event.release()));
......
......@@ -957,7 +957,7 @@ static bool executePrint(Frame* frame, Event*, EditorCommandSource, const String
Page* page = frame->page();
if (!page)
return false;
page->chrome()->print(frame);
page->chrome().print(frame);
return true;
}
......
......@@ -140,7 +140,7 @@ void CachedFrameBase::restore()
#if ENABLE(TOUCH_EVENTS)
if (m_document->hasTouchEventHandlers())
m_document->page()->chrome()->client()->needTouchEvents(true);
m_document->page()->chrome().client()->needTouchEvents(true);
#endif
m_document->documentDidResumeFromPageCache();
......
......@@ -50,13 +50,10 @@ void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event*)
return;
if (!element()->document()->page())
return;
Chrome* chrome = element()->document()->page()->chrome();
if (!chrome)
return;
DateTimeChooserParameters parameters;
if (!element()->setupDateTimeChooserParameters(parameters))
return;
m_dateTimeChooser = chrome->openDateTimeChooser(this, parameters);
m_dateTimeChooser = element()->document()->page()->chrome().openDateTimeChooser(this, parameters);
}
void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree()
......
......@@ -67,7 +67,7 @@ void HTMLFormControlElementWithState::notifyFormStateChanged()
return;
if (Page* page = frame->page())
page->chrome()->client()->formStateDidChange(this);
page->chrome().client()->formStateDidChange(this);
}
bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
......
......@@ -1656,7 +1656,7 @@ static void logMediaLoadRequest(Page* page, const String& mediaEngine, const Str
if (!page || !page->settings()->diagnosticLoggingEnabled())
return;
ChromeClient* client = page->chrome()->client();
ChromeClient* client = page->chrome().client();
if (!succeeded) {
client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), errorMessage, DiagnosticLoggingKeys::failKey());
......@@ -2656,7 +2656,7 @@ bool HTMLMediaElement::controls() const
return true;
// always show controls for video when fullscreen playback is required.
if (isVideo() && document()->page() && document()->page()->chrome()->requiresFullscreenForVideoPlayback())
if (isVideo() && document()->page() && document()->page()->chrome().requiresFullscreenForVideoPlayback())
return true;
// Always show controls when in full screen mode.
......@@ -3790,7 +3790,7 @@ GraphicsDeviceAdapter* HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter(const
if (!document() || !document()->page())
return 0;
return document()->page()->chrome()->client()->graphicsDeviceAdapter();
return document()->page()->chrome().client()->graphicsDeviceAdapter();
}
#endif
......@@ -3979,7 +3979,7 @@ void HTMLMediaElement::updatePlayState()
invalidateCachedTime();
if (playerPaused) {
if (!m_isFullscreen && isVideo() && document() && document()->page() && document()->page()->chrome()->requiresFullscreenForVideoPlayback())
if (!m_isFullscreen && isVideo() && document() && document()->page() && document()->page()->chrome().requiresFullscreenForVideoPlayback())
enterFullscreen();
// Set rate, muted before calling play in case they were set before the media engine was setup.
......@@ -4357,7 +4357,7 @@ void HTMLMediaElement::enterFullscreen()
if (hasMediaControls())
mediaControls()->enteredFullscreen();
if (document() && document()->page()) {
document()->page()->chrome()->client()->enterFullscreenForNode(this);
document()->page()->chrome().client()->enterFullscreenForNode(this);
scheduleEvent(eventNames().webkitbeginfullscreenEvent);
}
}
......@@ -4378,9 +4378,9 @@ void HTMLMediaElement::exitFullscreen()
if (hasMediaControls())
mediaControls()->exitedFullscreen();
if (document() && document()->page()) {
if (document()->page()->chrome()->requiresFullscreenForVideoPlayback())
if (document()->page()->chrome().requiresFullscreenForVideoPlayback())
pauseInternal();
document()->page()->chrome()->client()->exitFullscreenForNode(this);
document()->page()->chrome().client()->exitFullscreenForNode(this);
scheduleEvent(eventNames().webkitendfullscreenEvent);
}
}
......
......@@ -78,7 +78,7 @@ static const String titleText(Page* page, String mimeType)
if (!titleText.isEmpty())
return titleText;
titleText = page->chrome()->client()->plugInStartLabelTitle(mimeType);
titleText = page->chrome().client()->plugInStartLabelTitle(mimeType);
if (titleText.isEmpty())
titleText = snapshottedPlugInLabelTitle();
mimeTypeToLabelTitleMap.set(mimeType, titleText);
......@@ -92,7 +92,7 @@ static const String subtitleText(Page* page, String mimeType)
if (!subtitleText.isEmpty())
return subtitleText;
subtitleText = page->chrome()->client()->plugInStartLabelSubtitle(mimeType);
subtitleText = page->chrome().client()->plugInStartLabelSubtitle(mimeType);
if (subtitleText.isEmpty())
subtitleText = snapshottedPlugInLabelSubtitle();
mimeTypeToLabelSubtitleMap.set(mimeType, subtitleText);
......
......@@ -139,14 +139,14 @@ bool HTMLVideoElement::supportsFullscreen() const
#if ENABLE(FULLSCREEN_API)
// If the full screen API is enabled and is supported for the current element
// do not require that the player has a video track to enter full screen.
if (page->chrome()->client()->supportsFullScreenForElement(this, false))
if (page->chrome().client()->supportsFullScreenForElement(this, false))
return true;
#endif
if (!player()->hasVideo())
return false;
return page->chrome()->client()->supportsFullscreenForNode(this);
return page->chrome().client()->supportsFullscreenForNode(this);
}
unsigned HTMLVideoElement::videoWidth() const
......
......@@ -521,7 +521,7 @@ void InputType::dispatchSimulatedClickIfActive(KeyboardEvent* event) const
Chrome* InputType::chrome() const
{
if (Page* page = element()->document()->page())
return page->chrome();
return &page->chrome();
return 0;
}
......
......@@ -271,7 +271,7 @@ void MediaControls::enteredFullscreen()
m_fullScreenButton->setIsFullscreen(true);
if (Page* page = document()->page())
page->chrome()->setCursorHiddenUntilMouseMoves(true);
page->chrome().setCursorHiddenUntilMouseMoves(true);
startHideFullscreenControlsTimer();
}
......@@ -331,7 +331,7 @@ void MediaControls::hideFullscreenControlsTimerFired(Timer<MediaControls>*)
return;
if (Page* page = document()->page())
page->chrome()->setCursorHiddenUntilMouseMoves(true);
page->chrome().setCursorHiddenUntilMouseMoves(true);
makeTransparent();
}
......
......@@ -110,13 +110,10 @@ void PickerIndicatorElement::openPopup()
return;
if (!m_pickerIndicatorOwner)
return;
Chrome* chrome = document()->page()->chrome();
if (!chrome)
return;
DateTimeChooserParameters parameters;
if (!m_pickerIndicatorOwner->setupDateTimeChooserParameters(parameters))
return;
m_chooser = chrome->openDateTimeChooser(this, parameters);
m_chooser = document()->page()->chrome().openDateTimeChooser(this, parameters);
}
void PickerIndicatorElement::closePopup()
......
......@@ -121,10 +121,8 @@ void SpinButtonElement::defaultEventHandler(Event* event)
if (Frame* frame = document()->frame()) {
frame->eventHandler()->setCapturingMouseEventsNode(this);
m_capturing = true;
if (Page* page = document()->page()) {
if (page->chrome())
page->chrome()->registerPopupOpeningObserver(this);
}
if (Page* page = document()->page())
page->chrome().registerPopupOpeningObserver(this);
}
}
UpDownState oldUpDownState = m_upDownState;
......@@ -199,10 +197,8 @@ void SpinButtonElement::releaseCapture()
if (Frame* frame = document()->frame()) {
frame->eventHandler()->setCapturingMouseEventsNode(0);
m_capturing = false;
if (Page* page = document()->page()) {
if (page->chrome())
page->chrome()->unregisterPopupOpeningObserver(this);
}
if (Page* page = document()->page())
page->chrome().unregisterPopupOpeningObserver(this);
}
}
}
......
......@@ -228,9 +228,9 @@ void InspectorFrontendClientLocal::openInNewTab(const String& url)
void InspectorFrontendClientLocal::moveWindowBy(float x, float y)
{
FloatRect frameRect = m_frontendPage->chrome()->windowRect();
FloatRect frameRect = m_frontendPage->chrome().windowRect();
frameRect.move(x, y);
m_frontendPage->chrome()->setWindowRect(frameRect);
m_frontendPage->chrome().setWindowRect(frameRect);
}
void InspectorFrontendClientLocal::setAttachedWindow(DockSide dockSide)
......
......@@ -126,7 +126,7 @@ void InspectorInputAgent::dispatchMouseEvent(ErrorString* error, const String& t
// Some platforms may have flipped coordinate systems, but the given coordinates
// assume the origin is in the top-left of the window. Convert.
IntPoint convertedPoint = m_page->mainFrame()->view()->convertToContainingWindow(IntPoint(x, y));
IntPoint globalPoint = m_page->chrome()->rootViewToScreen(IntRect(IntPoint(x, y), IntSize(0, 0))).location();
IntPoint globalPoint = m_page->chrome().rootViewToScreen(IntRect(IntPoint(x, y), IntSize(0, 0))).location();
PlatformMouseEvent event(
convertedPoint,
......
......@@ -1167,7 +1167,7 @@ void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockHis
Frame* targetFrame = sourceFrame->loader()->findFrameForNavigation(request.frameName());
if (targetFrame && targetFrame != sourceFrame) {
if (Page* page = targetFrame->page())
page->chrome()->focus();
page->chrome().focus();
}
}
......@@ -1804,7 +1804,7 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage)
#if ENABLE(TOUCH_EVENTS)
if (isLoadingMainFrame())
m_frame->page()->chrome()->client()->needTouchEvents(false);
m_frame->page()->chrome().client()->needTouchEvents(false);
#endif
// Handle adding the URL to the back/forward list.
......@@ -2696,8 +2696,9 @@ void FrameLoader::callContinueLoadAfterNavigationPolicy(void* argument,
bool FrameLoader::shouldClose()
{
Page* page = m_frame->page();
Chrome* chrome = page ? page->chrome() : 0;
if (!chrome || !chrome->canRunBeforeUnloadConfirmPanel())
if (!page)
return true;
if (!page->chrome().canRunBeforeUnloadConfirmPanel())
return true;
// Store all references to each subframe in advance since beforeunload's event handler may modify frame
......@@ -2714,7 +2715,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;
}
......@@ -2728,7 +2729,7 @@ bool FrameLoader::shouldClose()
return shouldClose;
}
bool FrameLoader::fireBeforeUnloadEvent(Chrome* chrome)
bool FrameLoader::fireBeforeUnloadEvent(Chrome& chrome)
{
DOMWindow* domWindow = m_frame->document()->domWindow();
if (!domWindow)
......@@ -2749,7 +2750,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::continueLoadAfterNavigationPolicy(const ResourceRequest&, PassRefPtr<FormState> formState, bool shouldContinue)
......@@ -3333,7 +3334,7 @@ PassRefPtr<Frame> createWindow(Frame* openerFrame, Frame* lookupFrame, const Fra
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;
......@@ -3364,7 +3365,7 @@ PassRefPtr<Frame> createWindow(Frame* openerFrame, Frame* lookupFrame, const Fra
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;
......@@ -3375,18 +3376,18 @@ PassRefPtr<Frame> createWindow(Frame* openerFrame, Frame* lookupFrame, const Fra
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);
......@@ -3400,8 +3401,8 @@ PassRefPtr<Frame> createWindow(Frame* openerFrame, Frame* lookupFrame, const Fra
// 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;
......
......@@ -316,7 +316,7 @@ private:
static void callContinueLoadAfterNewWindowPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue);
static void callContinueFragmentScrollAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
bool fireBeforeUnloadEvent(Chrome*);
bool fireBeforeUnloadEvent(Chrome&);
void continueLoadAfterNavigationPolicy(const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
void continueLoadAfterNewWindowPolicy(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue);
......
......@@ -204,7 +204,7 @@ static void logPluginRequest(Page* page, const String& mimeType, const String& u
String pluginFile = pluginData ? pluginData->pluginFileForMimeType(newMIMEType) : String();
String description = !pluginFile ? newMIMEType : pluginFile;
ChromeClient* client = page->chrome()->client();
ChromeClient* client = page->chrome().client();
client->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), description, DiagnosticLoggingKeys::noopKey());
if (!page->hasSeenAnyPlugin())
......
......@@ -821,7 +821,7 @@ void ApplicationCacheGroup::didReachMaxAppCacheSize()
{
ASSERT(m_frame);
ASSERT(m_cacheBeingUpdated);
m_frame->page()->chrome()->client()->reachedMaxAppCacheSize(cacheStorage().spaceNeeded(m_cacheBeingUpdated->estimatedSizeInStorage()));
m_frame->page()->chrome().client()->reachedMaxAppCacheSize(cacheStorage().spaceNeeded(m_cacheBeingUpdated->estimatedSizeInStorage()));
m_calledReachedMaxAppCacheSize = true;
checkIfLoadIsComplete();
}
......@@ -830,7 +830,7 @@ void ApplicationCacheGroup::didReachOriginQuota(int64_t totalSpaceNeeded)
{
// Inform the client the origin quota has been reached, they may decide to increase the quota.
// We expect quota to be increased synchronously while waiting for the call to return.
m_frame->page()->chrome()->client()->reachedApplicationCacheOriginQuota(m_origin.get(), totalSpaceNeeded);
m_frame->page()->chrome().client()->reachedApplicationCacheOriginQuota(m_origin.get(), totalSpaceNeeded);
}
void ApplicationCacheGroup::cacheUpdateFailed()
......
......@@ -164,7 +164,7 @@ void AutoscrollController::updateDragAndDrop(Node* dropTargetNode, const IntPoin
}
Page* page = frame->page();
if (!page || !page->chrome()->client()->shouldAutoscrollForDragAndDrop(scrollable)) {
if (!page || !page->chrome().client()->shouldAutoscrollForDragAndDrop(scrollable)) {
stopAutoscrollTimer();