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

<https://webkit.org/b/120000> Chrome::client() should return a reference.

Reviewed by Antti Koivisto.

Chrome::m_client should never be null.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 73ce3fee
2013-08-19 Andreas Kling <akling@apple.com>
<https://webkit.org/b/120000> Chrome::client() should return a reference.
Reviewed by Antti Koivisto.
Chrome::m_client should never be null.
2013-08-19 Antti Koivisto <antti@apple.com>
<https://webkit.org/b/120004> Rename StyleElement to InlineStyleSheetOwner and stop inheriting from it
......@@ -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->isWorkerGlobalScope());
......
......@@ -1540,7 +1540,7 @@ 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) {
......@@ -3089,12 +3089,12 @@ static NSString* roleValueToNSString(AccessibilityRole value)
FrameView* frameView = m_object->documentFrameView();
Page* page = m_object->page();
if (page && frameView) {
ChromeClient* client = page->chrome().client();
client->focus();
ChromeClient& chromeClient = page->chrome().client();
chromeClient.focus();
if (frameView->platformWidget())
client->makeFirstResponder(frameView->platformWidget());
chromeClient.makeFirstResponder(frameView->platformWidget());
else
client->makeFirstResponder();
chromeClient.makeFirstResponder();
}
}
......
......@@ -142,9 +142,9 @@ void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject* o
return;
if (notification == AXLoadingStarted)
page->chrome().client()->AXStartFrameLoad();
page->chrome().client().AXStartFrameLoad();
else if (notification == AXLoadingFinished)
page->chrome().client()->AXFinishFrameLoad();
page->chrome().client().AXFinishFrameLoad();
}
AXID AXObjectCache::platformGenerateAXID() const
......
......@@ -203,7 +203,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);
......
......@@ -4981,12 +4981,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;
......@@ -5041,7 +5041,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;
......@@ -5132,12 +5132,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
......@@ -5262,7 +5262,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()
......@@ -5270,7 +5270,7 @@ void Document::fullScreenRendererDestroyed()
m_fullScreenRenderer = 0;
if (page())
page()->chrome().client()->fullScreenRendererChanged(0);
page()->chrome().client().fullScreenRendererChanged(0);
}
void Document::fullScreenChangeDelayTimerFired(Timer<Document>*)
......@@ -5553,7 +5553,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);
......@@ -5585,7 +5585,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
......@@ -5942,7 +5942,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())
......@@ -5958,7 +5958,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();
}
......@@ -5968,7 +5968,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;
......
......@@ -474,7 +474,7 @@ void Element::setActive(bool flag, 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) {
......@@ -2013,7 +2013,7 @@ void Element::dispatchFocusOutEvent(const AtomicString& eventType, PassRefPtr<El
void Element::dispatchFocusEvent(PassRefPtr<Element> oldFocusedElement, 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, oldFocusedElement);
EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(event.release()));
......@@ -2022,7 +2022,7 @@ void Element::dispatchFocusEvent(PassRefPtr<Element> oldFocusedElement, FocusDir
void Element::dispatchBlurEvent(PassRefPtr<Element> newFocusedElement)
{
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, newFocusedElement);
EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(event.release()));
......
......@@ -143,7 +143,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();
......
......@@ -71,7 +71,7 @@ void HTMLFormControlElementWithState::notifyFormStateChanged()
return;
if (Page* page = frame->page())
page->chrome().client()->formStateDidChange(this);
page->chrome().client().formStateDidChange(this);
}
bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
......
......@@ -1684,20 +1684,20 @@ static void logMediaLoadRequest(Page* page, const String& mediaEngine, const Str
if (!page || !page->settings().diagnosticLoggingEnabled())
return;
ChromeClient* client = page->chrome().client();
ChromeClient& chromeClient = page->chrome().client();
if (!succeeded) {
client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), errorMessage, DiagnosticLoggingKeys::failKey());
chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), errorMessage, DiagnosticLoggingKeys::failKey());
return;
}
client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
if (!page->hasSeenAnyMediaEngine())
client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
if (!page->hasSeenMediaEngine(mediaEngine))
client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsMediaEngineKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsMediaEngineKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
page->sawMediaEngine(mediaEngine);
}
......@@ -3823,7 +3823,7 @@ GraphicsDeviceAdapter* HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter(const
if (!document() || !document()->page())
return 0;
return document()->page()->chrome().client()->graphicsDeviceAdapter();
return document()->page()->chrome().client().graphicsDeviceAdapter();
}
#endif
......@@ -4412,7 +4412,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);
}
}
......@@ -4435,7 +4435,7 @@ void HTMLMediaElement::exitFullscreen()
if (document() && document()->page()) {
if (document()->page()->chrome().requiresFullscreenForVideoPlayback())
pauseInternal();
document()->page()->chrome().client()->exitFullscreenForNode(this);
document()->page()->chrome().client().exitFullscreenForNode(this);
scheduleEvent(eventNames().webkitendfullscreenEvent);
}
}
......
......@@ -75,7 +75,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);
......@@ -89,7 +89,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);
......
......@@ -140,14 +140,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
......
......@@ -1833,7 +1833,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.
......
......@@ -199,14 +199,14 @@ 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();
client->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), description, DiagnosticLoggingKeys::noopKey());
ChromeClient& chromeClient = page->chrome().client();
chromeClient.logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), description, DiagnosticLoggingKeys::noopKey());
if (!page->hasSeenAnyPlugin())
client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
if (!page->hasSeenPlugin(description))
client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsPluginKey(), description, DiagnosticLoggingKeys::noopKey());
chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsPluginKey(), description, DiagnosticLoggingKeys::noopKey());
page->sawPlugin(description);
}
......
......@@ -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()
......
......@@ -163,7 +163,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();
return;
}
......
This diff is collapsed.
......@@ -67,7 +67,7 @@ public:
static PassOwnPtr<Chrome> create(Page*, ChromeClient*);
ChromeClient* client() { return m_client; }
ChromeClient& client() { return m_client; }
// HostWindow methods.
virtual void invalidateRootView(const IntRect&, bool) OVERRIDE;
......@@ -188,7 +188,7 @@ private:
void notifyPopupOpeningObservers() const;
Page* m_page;
ChromeClient* m_client;
ChromeClient& m_client;
PlatformDisplayID m_displayID;
Vector<PopupOpeningObserver*> m_popupOpeningObservers;
};
......
......@@ -87,7 +87,7 @@ static void internalAddMessage(Page* page, MessageType type, MessageLevel level,
return;
if (gotMessage)
page->chrome().client()->addMessageToConsole(ConsoleAPIMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.columnNumber(), lastCaller.sourceURL());
page->chrome().client().addMessageToConsole(ConsoleAPIMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.columnNumber(), lastCaller.sourceURL());
if (!page->settings().logsPageMessagesToSystemConsoleEnabled() && !PageConsole::shouldPrintExceptions())
return;
......
......@@ -339,7 +339,7 @@ FloatRect DOMWindow::adjustWindowRect(Page* page, const FloatRect& pendingChange
if (!std::isnan(pendingChanges.height()))
window.setHeight(pendingChanges.height());
FloatSize minimumSize = page->chrome().client()->minimumWindowSize();
FloatSize minimumSize = page->chrome().client().minimumWindowSize();
window.setWidth(min(max(minimumSize.width(), window.width()), screen.width()));
window.setHeight(min(max(minimumSize.height(), window.height()), screen.height()));
......
......@@ -3707,7 +3707,7 @@ bool EventHandler::tabsToLinks(KeyboardEvent* event) const
if (!page)
return false;
bool tabsToLinksClientCallResult = page->chrome().client()->keyboardUIMode() & KeyboardAccessTabsToLinks;
bool tabsToLinksClientCallResult = page->chrome().client().keyboardUIMode() & KeyboardAccessTabsToLinks;
return eventInvertsTabsToLinksClientCallResult(event) ? !tabsToLinksClientCallResult : tabsToLinksClientCallResult;
}
......
......@@ -308,7 +308,7 @@ void Frame::setDocument(PassRefPtr<Document> newDoc)
notifyChromeClientWheelEventHandlerCountChanged();
#if ENABLE(TOUCH_EVENTS)
if (m_doc && m_doc->hasTouchEventHandlers())
m_page->chrome().client()->needTouchEvents(true);
m_page->chrome().client().needTouchEvents(true);
#endif
}
......@@ -845,7 +845,7 @@ IntRect Frame::tiledBackingStoreVisibleRect()
{
if (!m_page)
return IntRect();
return m_page->chrome().client()->visibleRectForTiledBackingStore();
return m_page->chrome().client().visibleRectForTiledBackingStore();
}
Color Frame::tiledBackingStoreBackgroundColor() const
......@@ -1007,7 +1007,7 @@ void Frame::notifyChromeClientWheelEventHandlerCountChanged() const
count += frame->document()->wheelEventHandlerCount();
}
m_page->chrome().client()->numWheelEventHandlersChanged(count);
m_page->chrome().client().numWheelEventHandlersChanged(count);
}
bool Frame::isURLAllowed(const KURL& url) const
......
......@@ -345,7 +345,7 @@ void FrameView::init()
}
Page* page = frame().page();
if (page && page->chrome().client()->shouldPaintEntireContents())
if (page && page->chrome().client().shouldPaintEntireContents())
setPaintsEntireContents(true);
}
......@@ -917,7 +917,7 @@ bool FrameView::flushCompositingStateForThisFrame(Frame* rootFrameForFlush)
void FrameView::setNeedsOneShotDrawingSynchronization()
{
if (Page* page = frame().page())
page->chrome().client()->setNeedsOneShotDrawingSynchronization();
page->chrome().client().setNeedsOneShotDrawingSynchronization();
}
#endif // USE(ACCELERATED_COMPOSITING)
......@@ -1380,7 +1380,7 @@ void FrameView::layout(bool allowSubtree)
return;
if (Page* page = frame().page())
page->chrome().client()->layoutUpdated(&frame());
page->chrome().client().layoutUpdated(&frame());
}
RenderBox* FrameView::embeddedContentBox() const
......@@ -2049,7 +2049,7 @@ void FrameView::updateFixedElementsAfterScrolling()
bool FrameView::shouldRubberBandInDirection(ScrollDirection direction) const
{
if (Page* page = frame().page())
return page->chrome().client()->shouldRubberBandInDirection(direction);
return page->chrome().client().shouldRubberBandInDirection(direction);
return ScrollView::shouldRubberBandInDirection(direction);
}
......@@ -3088,7 +3088,7 @@ void FrameView::setVisibleScrollerThumbRect(const IntRect& scrollerThumb)
if (!isMainFrameView())
return;
frame().page()->chrome().client()->notifyScrollerThumbIsVisibleInRect(scrollerThumb);
frame().page()->chrome().client().notifyScrollerThumbIsVisibleInRect(scrollerThumb);
}
bool FrameView::scrollbarsCanBeActive() const
......@@ -3176,7 +3176,7 @@ void FrameView::scrollbarStyleChanged(int newStyle, bool forceUpdate)
if (!isMainFrameView())
return;
frame().page()->chrome().client()->recommendedScrollbarStyleDidChange(newStyle);
frame().page()->chrome().client().recommendedScrollbarStyleDidChange(newStyle);
if (forceUpdate)
ScrollView::scrollbarStyleChanged(newStyle, forceUpdate);
......@@ -3247,7 +3247,7 @@ void FrameView::updateAnnotatedRegions()
Page* page = frame().page();
if (!page)
return;
page->chrome().client()->annotatedRegionsChanged();
page->chrome().client().annotatedRegionsChanged();
}
#endif
......@@ -3657,7 +3657,7 @@ void FrameView::paintOverhangAreas(GraphicsContext* context, const IntRect& hori
if (frame().document()->printing())
return;
if (isMainFrameView() && frame().page()->chrome().client()->paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect))
if (isMainFrameView() && frame().page()->chrome().client().paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect))
return;
ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect);
......
......@@ -171,7 +171,7 @@ void PageConsole::addMessage(MessageSource source, MessageLevel level, const Str
if (page->settings().privateBrowsingEnabled())
return;
page->chrome().client()->addMessageToConsole(source, level, message, lineNumber, columnNumber, url);
page->chrome().client().addMessageToConsole(source, level, message, lineNumber, columnNumber, url);
if (!page->settings().logsPageMessagesToSystemConsoleEnabled() && !shouldPrintExceptions())
return;
......
......@@ -195,7 +195,7 @@ bool PageGroup::isLinkVisited(LinkHash visitedLinkHash)
if (!m_visitedLinksPopulated) {
m_visitedLinksPopulated = true;
ASSERT(!m_pages.isEmpty());
(*m_pages.begin())->chrome().client()->populateVisitedLinks();
(*m_pages.begin())->chrome().client().populateVisitedLinks();
}
return m_visitedLinkHashes.contains(visitedLinkHash);
}
......
......@@ -41,8 +41,7 @@ PageThrottler::PageThrottler(Page* page)
, m_throttleState(PageNotThrottledState)
, m_throttleHysteresisTimer(this, &PageThrottler::throttleHysteresisTimerFired)
{
if (ChromeClient* chromeClient = m_page->chrome().client())
chromeClient->incrementActivePageCount();
m_page->chrome().client().incrementActivePageCount();
}
PageThrottler::~PageThrottler()
......@@ -52,18 +51,15 @@ PageThrottler::~PageThrottler()
for (HashSet<PageActivityAssertionToken*>::iterator i = m_activityTokens.begin(); i != m_activityTokens.end(); ++i)
(*i)->invalidate();
if (m_throttleState != PageThrottledState) {
if (ChromeClient* chromeClient = m_page->chrome().client())
chromeClient->decrementActivePageCount();
}
if (m_throttleState != PageThrottledState)
m_page->chrome().client().decrementActivePageCount();
}
void PageThrottler::throttlePage()
{
m_throttleState = PageThrottledState;
if (ChromeClient* chromeClient = m_page->chrome().client())
chromeClient->decrementActivePageCount();
m_page->chrome().client().decrementActivePageCount();
for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
if (frame->document())
......@@ -81,10 +77,8 @@ void PageThrottler::unthrottlePage()
if (oldState == PageNotThrottledState)
return;
if (oldState == PageThrottledState) {
if (ChromeClient* chromeClient = m_page->chrome().client())
chromeClient->incrementActivePageCount();
}
if (oldState == PageThrottledState)
m_page->chrome().client().incrementActivePageCount();
for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
if (frame->document())
......
......@@ -68,7 +68,7 @@ void PointerLockController::requestPointerLock(Element* target)
}
enqueueEvent(eventNames().webkitpointerlockchangeEvent, target);
m_element = target;
} else if (m_page->chrome().client()->requestPointerLock()) {
} else if (m_page->chrome().client().requestPointerLock()) {
m_lockPending = true;
m_element = target;
} else {
......@@ -78,7 +78,7 @@ void PointerLockController::requestPointerLock(Element* target)
void PointerLockController::requestPointerUnlock()
{
return m_page->chrome().client()->requestPointerUnlock();
return m_page->chrome().client().requestPointerUnlock();
}
void PointerLockController::elementRemoved(Element* element)
......
......@@ -32,25 +32,25 @@ void Chrome::focusNSView(NSView* view)
// Handle the WK2 case where there is no view passed in.
if (!view) {
client()->makeFirstResponder();
client().makeFirstResponder();
return;
}