diff --git a/engine/core/core.gni b/engine/core/core.gni index 781efc002aa..4816142686a 100644 --- a/engine/core/core.gni +++ b/engine/core/core.gni @@ -980,8 +980,6 @@ sky_core_files = [ "loader/UniqueIdentifier.h", "page/AutoscrollController.cpp", "page/AutoscrollController.h", - "page/Chrome.cpp", - "page/Chrome.h", "page/ChromeClient.h", "page/EditorClient.h", "page/EventHandler.cpp", diff --git a/engine/core/dom/Document.cpp b/engine/core/dom/Document.cpp index a885f2b180f..08ac3d570a0 100644 --- a/engine/core/dom/Document.cpp +++ b/engine/core/dom/Document.cpp @@ -112,7 +112,6 @@ #include "sky/engine/core/inspector/InspectorTraceEvents.h" #include "sky/engine/core/loader/FrameLoaderClient.h" #include "sky/engine/core/loader/ImageLoader.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/FocusController.h" @@ -1683,7 +1682,7 @@ bool Document::setFocusedElement(PassRefPtr prpNewFocusedElement, Focus } if (!focusChangeBlocked && frameHost()) - frameHost()->chrome().focusedNodeChanged(m_focusedElement.get()); + page()->focusedNodeChanged(m_focusedElement.get()); SetFocusedElementDone: updateRenderTreeIfNeeded(); diff --git a/engine/core/dom/Element.cpp b/engine/core/dom/Element.cpp index ee5cd982c6e..2270444ae54 100644 --- a/engine/core/dom/Element.cpp +++ b/engine/core/dom/Element.cpp @@ -74,7 +74,6 @@ #include "sky/engine/core/html/HTMLTemplateElement.h" #include "sky/engine/core/html/parser/HTMLDocumentParser.h" #include "sky/engine/core/html/parser/HTMLParserIdioms.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/FocusController.h" #include "sky/engine/core/page/Page.h" diff --git a/engine/core/editing/EditorCommand.cpp b/engine/core/editing/EditorCommand.cpp index 6d5fcee6b36..20f3b0733c7 100644 --- a/engine/core/editing/EditorCommand.cpp +++ b/engine/core/editing/EditorCommand.cpp @@ -46,7 +46,6 @@ #include "sky/engine/core/frame/LocalFrame.h" #include "sky/engine/core/frame/Settings.h" #include "sky/engine/core/html/HTMLImageElement.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/EditorClient.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/rendering/RenderBox.h" diff --git a/engine/core/editing/InputMethodController.cpp b/engine/core/editing/InputMethodController.cpp index e61869fc3e4..b96e985314c 100644 --- a/engine/core/editing/InputMethodController.cpp +++ b/engine/core/editing/InputMethodController.cpp @@ -35,7 +35,6 @@ #include "sky/engine/core/editing/TypingCommand.h" #include "sky/engine/core/events/CompositionEvent.h" #include "sky/engine/core/frame/LocalFrame.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/rendering/RenderObject.h" @@ -140,11 +139,7 @@ bool InputMethodController::confirmCompositionOrInsertText(const String& text, C void InputMethodController::confirmCompositionAndResetState() { - if (!hasComposition()) - return; - - // ChromeClient::willSetInputMethodState() resets input method and the composition string is committed. - m_frame.chromeClient().willSetInputMethodState(); + // TODO(esprehn): Remove this. } void InputMethodController::cancelComposition() diff --git a/engine/core/frame/Console.cpp b/engine/core/frame/Console.cpp index b4f20988db9..c4ab4406210 100644 --- a/engine/core/frame/Console.cpp +++ b/engine/core/frame/Console.cpp @@ -30,16 +30,17 @@ #include "sky/engine/core/frame/Console.h" #include "sky/engine/bindings/core/v8/ScriptCallStackFactory.h" +#include "sky/engine/core/dom/Document.h" #include "sky/engine/core/frame/ConsoleTypes.h" #include "sky/engine/core/frame/FrameConsole.h" #include "sky/engine/core/frame/FrameHost.h" #include "sky/engine/core/frame/LocalFrame.h" #include "sky/engine/core/inspector/ConsoleAPITypes.h" +#include "sky/engine/core/inspector/ConsoleMessage.h" #include "sky/engine/core/inspector/ScriptArguments.h" -#include "sky/engine/core/page/Chrome.h" +#include "sky/engine/core/inspector/ScriptCallStack.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/platform/TraceEvent.h" -#include "sky/engine/core/inspector/ScriptCallStack.h" #include "sky/engine/wtf/text/CString.h" #include "sky/engine/wtf/text/WTFString.h" diff --git a/engine/core/frame/Frame.cpp b/engine/core/frame/Frame.cpp index 115d89ee66f..5d11025172e 100644 --- a/engine/core/frame/Frame.cpp +++ b/engine/core/frame/Frame.cpp @@ -36,7 +36,6 @@ #include "sky/engine/core/frame/Settings.h" #include "sky/engine/core/loader/EmptyClients.h" #include "sky/engine/core/loader/FrameLoaderClient.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/FocusController.h" @@ -103,17 +102,4 @@ void Frame::setDOMWindow(PassRefPtr domWindow) m_domWindow = domWindow; } -static ChromeClient& emptyChromeClient() -{ - DEFINE_STATIC_LOCAL(EmptyChromeClient, client, ()); - return client; -} - -ChromeClient& Frame::chromeClient() const -{ - if (Page* page = this->page()) - return page->chrome().client(); - return emptyChromeClient(); -} - } // namespace blink diff --git a/engine/core/frame/Frame.h b/engine/core/frame/Frame.h index e394fa89bad..0324a9fb342 100644 --- a/engine/core/frame/Frame.h +++ b/engine/core/frame/Frame.h @@ -66,8 +66,6 @@ public: virtual void setDOMWindow(PassRefPtr); LocalDOMWindow* domWindow() const; - ChromeClient& chromeClient() const; - Settings* settings() const; // can be null protected: diff --git a/engine/core/frame/FrameConsole.cpp b/engine/core/frame/FrameConsole.cpp index 4bb1fe3419a..bfaac87f8c0 100644 --- a/engine/core/frame/FrameConsole.cpp +++ b/engine/core/frame/FrameConsole.cpp @@ -30,16 +30,16 @@ #include "sky/engine/core/frame/FrameConsole.h" #include "sky/engine/bindings/core/v8/ScriptCallStackFactory.h" +#include "sky/engine/core/dom/Document.h" #include "sky/engine/core/frame/FrameHost.h" #include "sky/engine/core/inspector/ConsoleAPITypes.h" #include "sky/engine/core/inspector/ConsoleMessage.h" #include "sky/engine/core/inspector/ConsoleMessageStorage.h" #include "sky/engine/core/inspector/ScriptArguments.h" -#include "sky/engine/core/page/Chrome.h" +#include "sky/engine/core/inspector/ScriptCallStack.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/Page.h" #include "sky/engine/platform/network/ResourceResponse.h" -#include "sky/engine/core/inspector/ScriptCallStack.h" #include "sky/engine/wtf/text/StringBuilder.h" namespace blink { @@ -98,7 +98,7 @@ void FrameConsole::addMessage(PassRefPtr prpConsoleMessage) RefPtr reportedCallStack = nullptr; if (consoleMessage->source() != ConsoleAPIMessageSource) { - if (consoleMessage->callStack() && m_frame.chromeClient().shouldReportDetailedMessageForSource(messageURL)) + if (consoleMessage->callStack() && m_frame.page()->shouldReportDetailedMessageForSource(messageURL)) reportedCallStack = consoleMessage->callStack(); } else { if (!m_frame.host() || (consoleMessage->scriptArguments() && consoleMessage->scriptArguments()->argumentCount() == 0)) @@ -107,14 +107,14 @@ void FrameConsole::addMessage(PassRefPtr prpConsoleMessage) if (!allClientReportingMessageTypes().contains(consoleMessage->type())) return; - if (m_frame.chromeClient().shouldReportDetailedMessageForSource(messageURL)) + if (m_frame.page()->shouldReportDetailedMessageForSource(messageURL)) reportedCallStack = createScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture); } String stackTrace; if (reportedCallStack) stackTrace = FrameConsole::formatStackTraceString(consoleMessage->message(), reportedCallStack); - m_frame.chromeClient().addMessageToConsole(&m_frame, consoleMessage->source(), consoleMessage->level(), consoleMessage->message(), lineNumber, messageURL, stackTrace); + m_frame.page()->addMessageToConsole(&m_frame, consoleMessage->source(), consoleMessage->level(), consoleMessage->message(), lineNumber, messageURL, stackTrace); } void FrameConsole::reportResourceResponseReceived(Document* document, unsigned long requestIdentifier, const ResourceResponse& response) diff --git a/engine/core/frame/FrameHost.cpp b/engine/core/frame/FrameHost.cpp index 738ac1fd749..7ac39500d5f 100644 --- a/engine/core/frame/FrameHost.cpp +++ b/engine/core/frame/FrameHost.cpp @@ -31,8 +31,6 @@ #include "sky/engine/config.h" #include "sky/engine/core/frame/FrameHost.h" -#include "sky/engine/core/page/Chrome.h" -#include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/Page.h" namespace blink { @@ -58,11 +56,6 @@ Settings& FrameHost::settings() const return m_page->settings(); } -Chrome& FrameHost::chrome() const -{ - return m_page->chrome(); -} - float FrameHost::deviceScaleFactor() const { return m_page->deviceScaleFactor(); diff --git a/engine/core/frame/FrameHost.h b/engine/core/frame/FrameHost.h index 083406c431e..f17c1e81c1d 100644 --- a/engine/core/frame/FrameHost.h +++ b/engine/core/frame/FrameHost.h @@ -39,7 +39,6 @@ namespace blink { -class Chrome; class Page; class ServiceProvider; class Settings; @@ -62,7 +61,6 @@ public: // Careful: This function will eventually be removed. Page& page() const { return *m_page; } Settings& settings() const; - Chrome& chrome() const; ServiceProvider& services() const { return m_services; } diff --git a/engine/core/frame/FrameView.cpp b/engine/core/frame/FrameView.cpp index 6d1c3a3b09d..8883ffac5b4 100644 --- a/engine/core/frame/FrameView.cpp +++ b/engine/core/frame/FrameView.cpp @@ -40,7 +40,6 @@ #include "sky/engine/core/html/parser/TextResourceDecoder.h" #include "sky/engine/core/inspector/InspectorTraceEvents.h" #include "sky/engine/core/loader/FrameLoaderClient.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/FocusController.h" @@ -361,15 +360,6 @@ void FrameView::layout(bool allowSubtree) // Post-layout assert that nobody was re-marked as needing layout during layout. document->renderView()->assertSubtreeIsLaidOut(); #endif - - // FIXME: It should be not possible to remove the FrameView from the frame/page during layout - // however m_inPerformLayout is not set for most of this function, so none of our RELEASE_ASSERTS - // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecting the LocalFrame from - // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.html - // necessitating this check here. - // ASSERT(frame()->page()); - if (frame().page()) - frame().page()->chrome().client().layoutUpdated(m_frame.get()); } DocumentLifecycle& FrameView::lifecycle() const @@ -414,10 +404,7 @@ void FrameView::setLayoutSize(const IntSize& size) HostWindow* FrameView::hostWindow() const { - Page* page = frame().page(); - if (!page) - return 0; - return &page->chrome(); + return frame().page(); } void FrameView::contentsResized() @@ -855,7 +842,7 @@ void FrameView::setCursor(const Cursor& cursor) Page* page = frame().page(); if (!page || !page->settings().deviceSupportsMouse()) return; - page->chrome().setCursor(cursor); + page->setCursor(cursor); } void FrameView::setLayoutSizeInternal(const IntSize& size) diff --git a/engine/core/frame/LocalDOMWindow.cpp b/engine/core/frame/LocalDOMWindow.cpp index 861fda5528a..a5df018be07 100644 --- a/engine/core/frame/LocalDOMWindow.cpp +++ b/engine/core/frame/LocalDOMWindow.cpp @@ -65,7 +65,6 @@ #include "sky/engine/core/inspector/ConsoleMessageStorage.h" #include "sky/engine/core/inspector/InspectorTraceEvents.h" #include "sky/engine/core/loader/FrameLoaderClient.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/Page.h" @@ -151,7 +150,7 @@ FloatRect LocalDOMWindow::adjustWindowRect(LocalFrame& frame, const FloatRect& p ASSERT(host); FloatRect screen = screenAvailableRect(frame.view()); - FloatRect window = host->chrome().windowRect(); + FloatRect window = host->page().windowRect(); // Make sure we're in a valid state before adjusting dimensions. ASSERT(std::isfinite(screen.x())); @@ -173,7 +172,8 @@ FloatRect LocalDOMWindow::adjustWindowRect(LocalFrame& frame, const FloatRect& p if (!std::isnan(pendingChanges.height())) window.setHeight(pendingChanges.height()); - FloatSize minimumSize = host->chrome().client().minimumWindowSize(); + // TODO(esprehn): What? + FloatSize minimumSize = FloatSize(100, 100); // Let size 0 pass through, since that indicates default size, not minimum size. if (window.width()) window.setWidth(min(max(minimumSize.width(), window.width()), screen.width())); @@ -439,7 +439,7 @@ void LocalDOMWindow::focus(ExecutionContext* context) if (!host) return; - host->chrome().focus(); + host->page().focus(); if (!m_frame) return; @@ -456,7 +456,7 @@ int LocalDOMWindow::outerHeight() const if (!host) return 0; - return static_cast(host->chrome().windowRect().height()); + return static_cast(host->page().windowRect().height()); } int LocalDOMWindow::outerWidth() const @@ -468,7 +468,7 @@ int LocalDOMWindow::outerWidth() const if (!host) return 0; - return static_cast(host->chrome().windowRect().width()); + return static_cast(host->page().windowRect().width()); } int LocalDOMWindow::innerHeight() const @@ -504,7 +504,7 @@ int LocalDOMWindow::screenX() const if (!host) return 0; - return static_cast(host->chrome().windowRect().x()); + return static_cast(host->page().windowRect().x()); } int LocalDOMWindow::screenY() const @@ -516,7 +516,7 @@ int LocalDOMWindow::screenY() const if (!host) return 0; - return static_cast(host->chrome().windowRect().y()); + return static_cast(host->page().windowRect().y()); } LocalDOMWindow* LocalDOMWindow::window() const @@ -557,10 +557,10 @@ void LocalDOMWindow::moveBy(float x, float y) const if (!host) return; - FloatRect windowRect = host->chrome().windowRect(); + FloatRect windowRect = host->page().windowRect(); windowRect.move(x, y); // Security check (the spec talks about UniversalBrowserWrite to disable this check...) - host->chrome().setWindowRect(adjustWindowRect(*m_frame, windowRect)); + host->page().setWindowRect(adjustWindowRect(*m_frame, windowRect)); } void LocalDOMWindow::moveTo(float x, float y) const @@ -572,10 +572,10 @@ void LocalDOMWindow::moveTo(float x, float y) const if (!host) return; - FloatRect windowRect = host->chrome().windowRect(); + FloatRect windowRect = host->page().windowRect(); windowRect.setLocation(FloatPoint(x, y)); // Security check (the spec talks about UniversalBrowserWrite to disable this check...) - host->chrome().setWindowRect(adjustWindowRect(*m_frame, windowRect)); + host->page().setWindowRect(adjustWindowRect(*m_frame, windowRect)); } void LocalDOMWindow::resizeBy(float x, float y) const @@ -587,10 +587,10 @@ void LocalDOMWindow::resizeBy(float x, float y) const if (!host) return; - FloatRect fr = host->chrome().windowRect(); + FloatRect fr = host->page().windowRect(); FloatSize dest = fr.size() + FloatSize(x, y); FloatRect update(fr.location(), dest); - host->chrome().setWindowRect(adjustWindowRect(*m_frame, update)); + host->page().setWindowRect(adjustWindowRect(*m_frame, update)); } void LocalDOMWindow::resizeTo(float width, float height) const @@ -602,10 +602,10 @@ void LocalDOMWindow::resizeTo(float width, float height) const if (!host) return; - FloatRect fr = host->chrome().windowRect(); + FloatRect fr = host->page().windowRect(); FloatSize dest = FloatSize(width, height); FloatRect update(fr.location(), dest); - host->chrome().setWindowRect(adjustWindowRect(*m_frame, update)); + host->page().setWindowRect(adjustWindowRect(*m_frame, update)); } int LocalDOMWindow::requestAnimationFrame(PassOwnPtr callback) diff --git a/engine/core/frame/LocalFrame.cpp b/engine/core/frame/LocalFrame.cpp index 3dfda41a958..bddcfa59074 100644 --- a/engine/core/frame/LocalFrame.cpp +++ b/engine/core/frame/LocalFrame.cpp @@ -49,7 +49,6 @@ #include "sky/engine/core/inspector/ConsoleMessageStorage.h" #include "sky/engine/core/loader/FrameLoaderClient.h" #include "sky/engine/core/loader/MojoLoader.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/FocusController.h" #include "sky/engine/core/page/Page.h" diff --git a/engine/core/html/HTMLAnchorElement.cpp b/engine/core/html/HTMLAnchorElement.cpp index 045193fad20..6b0ee928f90 100644 --- a/engine/core/html/HTMLAnchorElement.cpp +++ b/engine/core/html/HTMLAnchorElement.cpp @@ -35,7 +35,6 @@ #include "sky/engine/core/html/parser/HTMLParserIdioms.h" #include "sky/engine/core/loader/FrameLoaderClient.h" #include "sky/engine/core/loader/FrameLoaderTypes.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/rendering/RenderImage.h" #include "sky/engine/platform/network/ResourceRequest.h" diff --git a/engine/core/loader/EmptyClients.cpp b/engine/core/loader/EmptyClients.cpp index 6de1de3f07b..7d817046e00 100644 --- a/engine/core/loader/EmptyClients.cpp +++ b/engine/core/loader/EmptyClients.cpp @@ -35,9 +35,6 @@ namespace blink { void fillWithEmptyClients(Page::PageClients& pageClients) { - static ChromeClient* dummyChromeClient = adoptPtr(new EmptyChromeClient).leakPtr(); - pageClients.chromeClient = dummyChromeClient; - static EditorClient* dummyEditorClient = adoptPtr(new EmptyEditorClient).leakPtr(); pageClients.editorClient = dummyEditorClient; @@ -45,11 +42,6 @@ void fillWithEmptyClients(Page::PageClients& pageClients) pageClients.spellCheckerClient = dummySpellCheckerClient; } -String EmptyChromeClient::acceptLanguages() -{ - return String(); -} - NavigationPolicy EmptyFrameLoaderClient::decidePolicyForNavigation(const ResourceRequest&, Document*, NavigationPolicy, bool isTransitionNavigation) { return NavigationPolicyIgnore; diff --git a/engine/core/loader/EmptyClients.h b/engine/core/loader/EmptyClients.h index 7c79dfdaf24..9151be8608e 100644 --- a/engine/core/loader/EmptyClients.h +++ b/engine/core/loader/EmptyClients.h @@ -58,40 +58,6 @@ namespace blink { -class EmptyChromeClient : public ChromeClient { - WTF_MAKE_FAST_ALLOCATED; -public: - virtual ~EmptyChromeClient() { } - virtual void chromeDestroyed() override { } - - virtual void* webView() const override { return 0; } - virtual void setWindowRect(const FloatRect&) override { } - virtual FloatRect windowRect() override { return FloatRect(); } - - virtual FloatRect pageRect() override { return FloatRect(); } - - virtual void focus() override { } - - virtual bool canTakeFocus(FocusType) override { return false; } - virtual void takeFocus(FocusType) override { } - - virtual void focusedNodeChanged(Node*) override { } - virtual void focusedFrameChanged(LocalFrame*) override { } - virtual void show(NavigationPolicy) override { } - - virtual bool shouldReportDetailedMessageForSource(const String&) override { return false; } - virtual void addMessageToConsole(LocalFrame*, MessageSource, MessageLevel, const String&, unsigned, const String&, const String&) override { } - - virtual void scheduleVisualUpdate() override { } - - virtual IntRect rootViewToScreen(const IntRect& r) const override { return r; } - virtual blink::WebScreenInfo screenInfo() const override { return blink::WebScreenInfo(); } - - virtual void setCursor(const Cursor&) override { } - - virtual String acceptLanguages() override; -}; - class EmptyFrameLoaderClient : public FrameLoaderClient { WTF_MAKE_NONCOPYABLE(EmptyFrameLoaderClient); WTF_MAKE_FAST_ALLOCATED; public: diff --git a/engine/core/loader/FrameLoader.cpp b/engine/core/loader/FrameLoader.cpp index 9b92d238a5b..d0050c1c7c0 100644 --- a/engine/core/loader/FrameLoader.cpp +++ b/engine/core/loader/FrameLoader.cpp @@ -58,7 +58,6 @@ #include "sky/engine/core/loader/FrameFetchContext.h" #include "sky/engine/core/loader/FrameLoaderClient.h" #include "sky/engine/core/loader/UniqueIdentifier.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/Page.h" diff --git a/engine/core/page/AutoscrollController.cpp b/engine/core/page/AutoscrollController.cpp index f528ec124fd..6a9010f29d1 100644 --- a/engine/core/page/AutoscrollController.cpp +++ b/engine/core/page/AutoscrollController.cpp @@ -31,7 +31,6 @@ #include "sky/engine/core/frame/FrameView.h" #include "sky/engine/core/frame/LocalFrame.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/Page.h" #include "sky/engine/core/rendering/HitTestResult.h" diff --git a/engine/core/page/Chrome.cpp b/engine/core/page/Chrome.cpp deleted file mode 100644 index 6114c6f4b24..00000000000 --- a/engine/core/page/Chrome.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) - * Copyright (C) 2012, Samsung Electronics. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sky/engine/config.h" -#include "sky/engine/core/page/Chrome.h" - -#include "sky/engine/core/dom/Document.h" -#include "sky/engine/core/frame/LocalFrame.h" -#include "sky/engine/core/page/ChromeClient.h" -#include "sky/engine/core/rendering/HitTestResult.h" -#include "sky/engine/platform/Logging.h" -#include "sky/engine/platform/geometry/FloatRect.h" -#include "sky/engine/public/platform/WebScreenInfo.h" -#include "sky/engine/wtf/PassRefPtr.h" -#include "sky/engine/wtf/Vector.h" - -namespace blink { - -Chrome::Chrome(ChromeClient* client) - : m_client(client) -{ - ASSERT(m_client); -} - -Chrome::~Chrome() -{ -} - -PassOwnPtr Chrome::create(ChromeClient* client) -{ - return adoptPtr(new Chrome(client)); -} - -IntRect Chrome::rootViewToScreen(const IntRect& rect) const -{ - return m_client->rootViewToScreen(rect); -} - -blink::WebScreenInfo Chrome::screenInfo() const -{ - return m_client->screenInfo(); -} - -void Chrome::setWindowRect(const FloatRect& rect) const -{ - m_client->setWindowRect(rect); -} - -FloatRect Chrome::windowRect() const -{ - return m_client->windowRect(); -} - -FloatRect Chrome::pageRect() const -{ - return m_client->pageRect(); -} - -void Chrome::focus() const -{ - m_client->focus(); -} - -bool Chrome::canTakeFocus(FocusType type) const -{ - return m_client->canTakeFocus(type); -} - -void Chrome::takeFocus(FocusType type) const -{ - m_client->takeFocus(type); -} - -void Chrome::focusedNodeChanged(Node* node) const -{ - m_client->focusedNodeChanged(node); -} - -void Chrome::show(NavigationPolicy policy) const -{ - m_client->show(policy); -} - -void Chrome::setCursor(const Cursor& cursor) -{ - m_client->setCursor(cursor); -} - -void Chrome::scheduleVisualUpdate() -{ - m_client->scheduleVisualUpdate(); -} - -void Chrome::willBeDestroyed() -{ - m_client->chromeDestroyed(); -} - -} // namespace blink diff --git a/engine/core/page/Chrome.h b/engine/core/page/Chrome.h deleted file mode 100644 index aae2088c63f..00000000000 --- a/engine/core/page/Chrome.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). - * Copyright (C) 2012, Samsung Electronics. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_PAGE_CHROME_H_ -#define SKY_ENGINE_CORE_PAGE_CHROME_H_ - -#include "sky/engine/core/loader/NavigationPolicy.h" -#include "sky/engine/core/page/FocusType.h" -#include "sky/engine/platform/Cursor.h" -#include "sky/engine/platform/HostWindow.h" -#include "sky/engine/wtf/Forward.h" - -namespace blink { - -class ChromeClient; -class ColorChooser; -class ColorChooserClient; -class DateTimeChooser; -class DateTimeChooserClient; -class FloatRect; -class LocalFrame; -class HitTestResult; -class IntRect; -class Node; -class Page; - -struct DateTimeChooserParameters; - -class Chrome final : public HostWindow { -public: - virtual ~Chrome(); - - static PassOwnPtr create(ChromeClient*); - - ChromeClient& client() { return *m_client; } - - // HostWindow methods. - virtual IntRect rootViewToScreen(const IntRect&) const override; - virtual blink::WebScreenInfo screenInfo() const override; - - virtual void scheduleVisualUpdate() override; - - void setCursor(const Cursor&); - - void setWindowRect(const FloatRect&) const; - FloatRect windowRect() const; - - FloatRect pageRect() const; - - void focus() const; - - bool canTakeFocus(FocusType) const; - void takeFocus(FocusType) const; - - void focusedNodeChanged(Node*) const; - - void show(NavigationPolicy = NavigationPolicyIgnore) const; - - void willBeDestroyed(); - -private: - Chrome(ChromeClient*); - - ChromeClient* m_client; -}; - -} - -#endif // SKY_ENGINE_CORE_PAGE_CHROME_H_ diff --git a/engine/core/page/ChromeClient.h b/engine/core/page/ChromeClient.h index 912ad96db91..4221b00c26d 100644 --- a/engine/core/page/ChromeClient.h +++ b/engine/core/page/ChromeClient.h @@ -22,59 +22,35 @@ #ifndef SKY_ENGINE_CORE_PAGE_CHROMECLIENT_H_ #define SKY_ENGINE_CORE_PAGE_CHROMECLIENT_H_ -#include "sky/engine/core/dom/Document.h" #include "sky/engine/core/frame/ConsoleTypes.h" #include "sky/engine/core/inspector/ConsoleAPITypes.h" -#include "sky/engine/core/loader/NavigationPolicy.h" #include "sky/engine/core/page/FocusType.h" -#include "sky/engine/core/rendering/style/RenderStyleConstants.h" #include "sky/engine/platform/Cursor.h" -#include "sky/engine/platform/HostWindow.h" -#include "sky/engine/platform/scroll/ScrollTypes.h" +#include "sky/engine/public/platform/WebScreenInfo.h" #include "sky/engine/wtf/Forward.h" -#include "sky/engine/wtf/PassOwnPtr.h" -#include "sky/engine/wtf/Vector.h" namespace blink { -class ColorChooser; -class ColorChooserClient; -class DateTimeChooser; -class DateTimeChooserClient; class Element; class FloatRect; -class Frame; -class GraphicsContext; -class HitTestResult; class IntRect; class LocalFrame; class Node; -class Page; -class Widget; struct DateTimeChooserParameters; struct GraphicsDeviceAdapter; class ChromeClient { public: - virtual void chromeDestroyed() = 0; - virtual void setWindowRect(const FloatRect&) = 0; virtual FloatRect windowRect() = 0; - virtual FloatRect pageRect() = 0; - virtual void focus() = 0; - virtual bool canTakeFocus(FocusType) = 0; virtual void takeFocus(FocusType) = 0; - virtual void focusedNodeChanged(Node*) = 0; - virtual void focusedFrameChanged(LocalFrame*) = 0; - virtual void show(NavigationPolicy) = 0; - virtual bool shouldReportDetailedMessageForSource(const String& source) = 0; virtual void addMessageToConsole(LocalFrame*, MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID, const String& stackTrace) = 0; @@ -83,28 +59,13 @@ public: // Methods used by HostWindow. virtual IntRect rootViewToScreen(const IntRect&) const = 0; virtual blink::WebScreenInfo screenInfo() const = 0; - virtual void setCursor(const Cursor&) = 0; virtual void scheduleVisualUpdate() = 0; // End methods used by HostWindow. - virtual void layoutUpdated(LocalFrame*) const { } + virtual void setCursor(const Cursor&) = 0; virtual String acceptLanguages() = 0; - enum DialogType { - AlertDialog = 0, - ConfirmDialog = 1, - PromptDialog = 2, - HTMLDialog = 3 - }; - - virtual FloatSize minimumWindowSize() const { return FloatSize(100, 100); }; - - virtual bool isChromeClientImpl() const { return false; } - - // Input mehtod editor related functions. - virtual void willSetInputMethodState() { } - protected: virtual ~ChromeClient() { } }; diff --git a/engine/core/page/EventHandler.cpp b/engine/core/page/EventHandler.cpp index 6b85d66cdda..a3ebb65acc2 100644 --- a/engine/core/page/EventHandler.cpp +++ b/engine/core/page/EventHandler.cpp @@ -49,7 +49,6 @@ #include "sky/engine/core/frame/Settings.h" #include "sky/engine/core/loader/FrameLoaderClient.h" #include "sky/engine/core/page/AutoscrollController.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/EditorClient.h" #include "sky/engine/core/page/FocusController.h" diff --git a/engine/core/page/FocusController.cpp b/engine/core/page/FocusController.cpp index 75df78eaedb..3ca343301c5 100644 --- a/engine/core/page/FocusController.cpp +++ b/engine/core/page/FocusController.cpp @@ -44,7 +44,6 @@ #include "sky/engine/core/frame/LocalFrame.h" #include "sky/engine/core/frame/Settings.h" #include "sky/engine/core/html/HTMLImageElement.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/Page.h" @@ -216,7 +215,7 @@ void FocusController::setFocusedFrame(PassRefPtr frame) m_isChangingFocusedFrame = false; - m_page->chrome().client().focusedFrameChanged(newFrame.get()); + m_page->focusedFrameChanged(newFrame.get()); } void FocusController::focusDocumentView(PassRefPtr frame) @@ -326,10 +325,10 @@ bool FocusController::advanceFocusInDocumentOrder(FocusType type, bool initialFo if (!node) { // We didn't find a node to focus, so we should try to pass focus to Chrome. - if (!initialFocus && m_page->chrome().canTakeFocus(type)) { + if (!initialFocus && m_page->canTakeFocus(type)) { document->setFocusedElement(nullptr); setFocusedFrame(nullptr); - m_page->chrome().takeFocus(type); + m_page->takeFocus(type); return true; } @@ -554,8 +553,6 @@ bool FocusController::setFocusedElement(Element* element, PassRefPtr if (oldFocusedElement && oldFocusedElement->isRootEditableElement() && !relinquishesEditingFocus(oldFocusedElement)) return false; - m_page->chrome().client().willSetInputMethodState(); - RefPtr newDocument = nullptr; if (element) newDocument = &element->document(); diff --git a/engine/core/page/Page.cpp b/engine/core/page/Page.cpp index b0b91bbd689..02451d5c797 100644 --- a/engine/core/page/Page.cpp +++ b/engine/core/page/Page.cpp @@ -21,6 +21,7 @@ #include "sky/engine/core/page/Page.h" #include "sky/engine/core/dom/ClientRectList.h" +#include "sky/engine/core/dom/Document.h" #include "sky/engine/core/dom/DocumentMarkerController.h" #include "sky/engine/core/dom/StyleEngine.h" #include "sky/engine/core/editing/Caret.h" @@ -35,14 +36,17 @@ #include "sky/engine/core/frame/LocalFrame.h" #include "sky/engine/core/frame/Settings.h" #include "sky/engine/core/page/AutoscrollController.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/FocusController.h" #include "sky/engine/core/page/PageLifecycleNotifier.h" #include "sky/engine/core/rendering/RenderView.h" +#include "sky/engine/platform/geometry/FloatRect.h" +#include "sky/engine/public/platform/WebScreenInfo.h" #include "sky/engine/wtf/HashMap.h" +#include "sky/engine/wtf/PassRefPtr.h" #include "sky/engine/wtf/RefCountedLeakCounter.h" #include "sky/engine/wtf/StdLibExtras.h" +#include "sky/engine/wtf/Vector.h" #include "sky/engine/wtf/text/Base64.h" namespace blink { @@ -63,7 +67,7 @@ Page::Page(PageClients& pageClients, ServiceProvider& services) : SettingsDelegate(Settings::create()) , m_animator(this) , m_autoscrollController(AutoscrollController::create(*this)) - , m_chrome(Chrome::create(pageClients.chromeClient)) + , m_chromeClient(pageClients.chromeClient) , m_dragCaretController(DragCaretController::create()) , m_focusController(FocusController::create(this)) , m_undoStack(UndoStack::create()) @@ -270,10 +274,79 @@ void Page::willBeDestroyed() pageCounter.decrement(); #endif - m_chrome->willBeDestroyed(); m_mainFrame = 0; } +IntRect Page::rootViewToScreen(const IntRect& rect) const +{ + return m_chromeClient->rootViewToScreen(rect); +} + +blink::WebScreenInfo Page::screenInfo() const +{ + return m_chromeClient->screenInfo(); +} + +void Page::setWindowRect(const FloatRect& rect) const +{ + m_chromeClient->setWindowRect(rect); +} + +FloatRect Page::windowRect() const +{ + return m_chromeClient->windowRect(); +} + +void Page::focus() const +{ + m_chromeClient->focus(); +} + +bool Page::canTakeFocus(FocusType type) const +{ + return m_chromeClient->canTakeFocus(type); +} + +void Page::takeFocus(FocusType type) const +{ + m_chromeClient->takeFocus(type); +} + +void Page::focusedNodeChanged(Node* node) const +{ + m_chromeClient->focusedNodeChanged(node); +} + +void Page::focusedFrameChanged(LocalFrame* frame) const +{ + m_chromeClient->focusedFrameChanged(frame); +} + +void Page::scheduleVisualUpdate() +{ + m_chromeClient->scheduleVisualUpdate(); +} + +void Page::setCursor(const Cursor& cursor) +{ + m_chromeClient->setCursor(cursor); +} + +bool Page::shouldReportDetailedMessageForSource(const String& source) +{ + return m_chromeClient->shouldReportDetailedMessageForSource(source); +} + +void Page::addMessageToConsole(LocalFrame* localFrame, MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID, const String& stackTrace) +{ + m_chromeClient->addMessageToConsole(localFrame, source, level, message, lineNumber, sourceID, stackTrace); +} + +void* Page::webView() const +{ + return m_chromeClient->webView(); +} + Page::PageClients::PageClients() : chromeClient(0) , editorClient(0) diff --git a/engine/core/page/Page.h b/engine/core/page/Page.h index 7f5bdc2f58e..1c21d612b5c 100644 --- a/engine/core/page/Page.h +++ b/engine/core/page/Page.h @@ -21,10 +21,15 @@ #ifndef SKY_ENGINE_CORE_PAGE_PAGE_H_ #define SKY_ENGINE_CORE_PAGE_PAGE_H_ +#include "sky/engine/core/frame/ConsoleTypes.h" #include "sky/engine/core/frame/LocalFrame.h" #include "sky/engine/core/frame/SettingsDelegate.h" +#include "sky/engine/core/inspector/ConsoleAPITypes.h" +#include "sky/engine/core/page/FocusType.h" #include "sky/engine/core/page/PageAnimator.h" #include "sky/engine/core/page/PageVisibilityState.h" +#include "sky/engine/platform/Cursor.h" +#include "sky/engine/platform/HostWindow.h" #include "sky/engine/platform/LifecycleContext.h" #include "sky/engine/platform/Supplementable.h" #include "sky/engine/platform/geometry/LayoutRect.h" @@ -38,15 +43,18 @@ namespace blink { class AutoscrollController; -class Chrome; class ChromeClient; class ClientRectList; class Document; class DragCaretController; class EditorClient; +class FloatRect; class FocusController; class Frame; class FrameHost; +class IntRect; +class LocalFrame; +class Node; class PageLifecycleNotifier; class Range; class RenderBox; @@ -62,7 +70,7 @@ typedef uint64_t LinkHash; float deviceScaleFactor(LocalFrame*); -class Page final : public Supplementable, public LifecycleContext, public SettingsDelegate { +class Page final : public Supplementable, public LifecycleContext, public SettingsDelegate, public HostWindow { WTF_MAKE_NONCOPYABLE(Page); friend class Settings; public: @@ -95,7 +103,6 @@ public: void documentDetached(Document*); PageAnimator& animator() { return m_animator; } - Chrome& chrome() const { return *m_chrome; } AutoscrollController& autoscrollController() const { return *m_autoscrollController; } DragCaretController& dragCaretController() const { return *m_dragCaretController; } FocusController& focusController() const { return *m_focusController; } @@ -136,10 +143,32 @@ public: void willBeDestroyed(); -protected: - PageLifecycleNotifier& lifecycleNotifier(); + // HostWindow methods. + virtual IntRect rootViewToScreen(const IntRect&) const override; + virtual blink::WebScreenInfo screenInfo() const override; + virtual void scheduleVisualUpdate() override; + + void setWindowRect(const FloatRect&) const; + FloatRect windowRect() const; + + void focus() const; + + bool canTakeFocus(FocusType) const; + void takeFocus(FocusType) const; + + void focusedNodeChanged(Node*) const; + void focusedFrameChanged(LocalFrame*) const; + + bool shouldReportDetailedMessageForSource(const String& source); + void addMessageToConsole(LocalFrame*, MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID, const String& stackTrace); + + void setCursor(const Cursor&); + + void* webView() const; private: + PageLifecycleNotifier& lifecycleNotifier(); + void initGroup(); void setTimerAlignmentInterval(double); @@ -151,7 +180,7 @@ private: PageAnimator m_animator; const OwnPtr m_autoscrollController; - const OwnPtr m_chrome; + ChromeClient* m_chromeClient; const OwnPtr m_dragCaretController; const OwnPtr m_focusController; const OwnPtr m_undoStack; diff --git a/engine/core/page/PageAnimator.cpp b/engine/core/page/PageAnimator.cpp index 89aeae4c928..bdc62a94197 100644 --- a/engine/core/page/PageAnimator.cpp +++ b/engine/core/page/PageAnimator.cpp @@ -6,9 +6,9 @@ #include "sky/engine/core/page/PageAnimator.h" #include "sky/engine/core/animation/DocumentAnimations.h" +#include "sky/engine/core/dom/Document.h" #include "sky/engine/core/frame/FrameView.h" #include "sky/engine/core/frame/LocalFrame.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/ChromeClient.h" #include "sky/engine/core/page/Page.h" #include "sky/engine/platform/Logging.h" @@ -43,7 +43,7 @@ void PageAnimator::scheduleVisualUpdate() { if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) return; - m_page->chrome().scheduleVisualUpdate(); + m_page->scheduleVisualUpdate(); } void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame) diff --git a/engine/core/rendering/RenderInline.cpp b/engine/core/rendering/RenderInline.cpp index d097c0bd354..ca9f658d568 100644 --- a/engine/core/rendering/RenderInline.cpp +++ b/engine/core/rendering/RenderInline.cpp @@ -24,7 +24,6 @@ #include "sky/engine/core/rendering/RenderInline.h" #include "sky/engine/core/dom/StyleEngine.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/Page.h" #include "sky/engine/core/rendering/HitTestResult.h" #include "sky/engine/core/rendering/InlineTextBox.h" diff --git a/engine/core/rendering/RenderLayerScrollableArea.cpp b/engine/core/rendering/RenderLayerScrollableArea.cpp index 5a9f9a6c7d7..98959de1a7f 100644 --- a/engine/core/rendering/RenderLayerScrollableArea.cpp +++ b/engine/core/rendering/RenderLayerScrollableArea.cpp @@ -50,7 +50,6 @@ #include "sky/engine/core/frame/FrameView.h" #include "sky/engine/core/frame/LocalFrame.h" #include "sky/engine/core/inspector/InspectorTraceEvents.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/FocusController.h" #include "sky/engine/core/page/Page.h" @@ -99,9 +98,7 @@ RenderLayerScrollableArea::~RenderLayerScrollableArea() HostWindow* RenderLayerScrollableArea::hostWindow() const { - if (Page* page = box().frame()->page()) - return &page->chrome(); - return nullptr; + return box().frame()->page(); } bool RenderLayerScrollableArea::isActive() const diff --git a/engine/public/web/WebViewClient.h b/engine/public/web/WebViewClient.h index 5cae7b1291d..c3334409390 100644 --- a/engine/public/web/WebViewClient.h +++ b/engine/public/web/WebViewClient.h @@ -118,13 +118,6 @@ public: // Called when a new node gets focused. virtual void focusedNodeChanged(const WebNode&) { } - // Indicates two things: - // 1) This view may have a new layout now. - // 2) Calling layout() is a no-op. - // After calling WebWidget::layout(), expect to get this notification - // unless the view did not need a layout. - virtual void didUpdateLayout() { } - // Returns comma separated list of accept languages. virtual WebString acceptLanguages() { return WebString(); } diff --git a/engine/web/ChromeClientImpl.cpp b/engine/web/ChromeClientImpl.cpp index cccb2605831..f85c3c2ecb8 100644 --- a/engine/web/ChromeClientImpl.cpp +++ b/engine/web/ChromeClientImpl.cpp @@ -86,11 +86,6 @@ void* ChromeClientImpl::webView() const return static_cast(m_webView); } -void ChromeClientImpl::chromeDestroyed() -{ - // Our lifetime is bound to the WebViewImpl. -} - void ChromeClientImpl::setWindowRect(const FloatRect& r) { if (m_webView->client()) @@ -112,14 +107,6 @@ FloatRect ChromeClientImpl::windowRect() return FloatRect(rect); } -FloatRect ChromeClientImpl::pageRect() -{ - // We hide the details of the window's border thickness from the web page by - // simple re-using the window position here. So, from the point-of-view of - // the web page, the window has no border. - return windowRect(); -} - void ChromeClientImpl::focus() { } @@ -163,10 +150,6 @@ WebNavigationPolicy ChromeClientImpl::getNavigationPolicy() return WebNavigationPolicyCurrentTab; } -void ChromeClientImpl::show(NavigationPolicy navigationPolicy) -{ -} - bool ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url) { WebLocalFrameImpl* webframe = m_webView->mainFrameImpl(); @@ -238,11 +221,6 @@ WebScreenInfo ChromeClientImpl::screenInfo() const return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenInfo(); } -void ChromeClientImpl::layoutUpdated(LocalFrame* frame) const -{ - m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame)); -} - void ChromeClientImpl::setCursor(const Cursor& cursor) { setCursor(WebCursorInfo(cursor)); @@ -257,8 +235,4 @@ String ChromeClientImpl::acceptLanguages() return m_webView->client()->acceptLanguages(); } -void ChromeClientImpl::willSetInputMethodState() -{ -} - } // namespace blink diff --git a/engine/web/ChromeClientImpl.h b/engine/web/ChromeClientImpl.h index c5d90e5ee5b..30d514fa348 100644 --- a/engine/web/ChromeClientImpl.h +++ b/engine/web/ChromeClientImpl.h @@ -59,16 +59,14 @@ public: virtual void* webView() const override; // ChromeClient methods: - virtual void chromeDestroyed() override; virtual void setWindowRect(const FloatRect&) override; virtual FloatRect windowRect() override; - virtual FloatRect pageRect() override; virtual void focus() override; virtual bool canTakeFocus(FocusType) override; virtual void takeFocus(FocusType) override; virtual void focusedNodeChanged(Node*) override; virtual void focusedFrameChanged(LocalFrame*) override; - virtual void show(NavigationPolicy) override; + virtual bool shouldReportDetailedMessageForSource(const WTF::String&) override; virtual void addMessageToConsole( LocalFrame*, MessageSource, MessageLevel, @@ -77,28 +75,18 @@ public: virtual void scheduleVisualUpdate() override; virtual IntRect rootViewToScreen(const IntRect&) const override; virtual WebScreenInfo screenInfo() const override; - virtual void layoutUpdated(LocalFrame*) const override; virtual void setCursor(const Cursor&) override; // ChromeClient methods: virtual String acceptLanguages() override; - // ChromeClientImpl: - void setNewWindowNavigationPolicy(WebNavigationPolicy); - - virtual void willSetInputMethodState() override; - private: - virtual bool isChromeClientImpl() const override { return true; } - WebNavigationPolicy getNavigationPolicy(); void setCursor(const WebCursorInfo&); WebViewImpl* m_webView; // weak pointer }; -DEFINE_TYPE_CASTS(ChromeClientImpl, ChromeClient, client, client->isChromeClientImpl(), client.isChromeClientImpl()); - } // namespace blink #endif // SKY_ENGINE_WEB_CHROMECLIENTIMPL_H_ diff --git a/engine/web/FrameLoaderClientImpl.cpp b/engine/web/FrameLoaderClientImpl.cpp index 7010967e280..063062acbfc 100644 --- a/engine/web/FrameLoaderClientImpl.cpp +++ b/engine/web/FrameLoaderClientImpl.cpp @@ -38,7 +38,6 @@ #include "sky/engine/core/frame/FrameView.h" #include "sky/engine/core/frame/Settings.h" #include "sky/engine/core/html/HTMLIFrameElement.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/Page.h" #include "sky/engine/core/rendering/HitTestResult.h" diff --git a/engine/web/SpellCheckerClientImpl.cpp b/engine/web/SpellCheckerClientImpl.cpp index cd45d2eba3e..6043fad2982 100644 --- a/engine/web/SpellCheckerClientImpl.cpp +++ b/engine/web/SpellCheckerClientImpl.cpp @@ -27,6 +27,7 @@ #include "sky/engine/config.h" #include "sky/engine/web/SpellCheckerClientImpl.h" +#include "sky/engine/core/dom/Document.h" #include "sky/engine/core/dom/DocumentMarkerController.h" #include "sky/engine/core/dom/Element.h" #include "sky/engine/core/editing/Editor.h" diff --git a/engine/web/WebLocalFrameImpl.cpp b/engine/web/WebLocalFrameImpl.cpp index 2813ed7aa83..61722497895 100644 --- a/engine/web/WebLocalFrameImpl.cpp +++ b/engine/web/WebLocalFrameImpl.cpp @@ -102,7 +102,6 @@ #include "sky/engine/core/html/HTMLAnchorElement.h" #include "sky/engine/core/inspector/ConsoleMessage.h" #include "sky/engine/core/loader/MojoLoader.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/FocusController.h" #include "sky/engine/core/page/Page.h" diff --git a/engine/web/WebViewImpl.cpp b/engine/web/WebViewImpl.cpp index 4d1f95f7b2c..b2db8490c33 100644 --- a/engine/web/WebViewImpl.cpp +++ b/engine/web/WebViewImpl.cpp @@ -53,7 +53,6 @@ #include "sky/engine/core/loader/FrameLoader.h" #include "sky/engine/core/loader/UniqueIdentifier.h" #include "sky/engine/core/page/AutoscrollController.h" -#include "sky/engine/core/page/Chrome.h" #include "sky/engine/core/page/EventHandler.h" #include "sky/engine/core/page/FocusController.h" #include "sky/engine/core/page/Page.h" @@ -196,7 +195,7 @@ WebViewImpl* WebViewImpl::fromPage(Page* page) { if (!page) return 0; - return static_cast(page->chrome().client().webView()); + return static_cast(page->webView()); } // WebWidget ------------------------------------------------------------------ @@ -823,13 +822,6 @@ void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag { } -void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe) -{ - if (!m_client) - return; - m_client->didUpdateLayout(); -} - void WebViewImpl::setBackgroundColorOverride(WebColor color) { m_backgroundColorOverride = color; diff --git a/engine/web/WebViewImpl.h b/engine/web/WebViewImpl.h index b72cf0f712b..ffec450d9a1 100644 --- a/engine/web/WebViewImpl.h +++ b/engine/web/WebViewImpl.h @@ -31,6 +31,7 @@ #ifndef SKY_ENGINE_WEB_WEBVIEWIMPL_H_ #define SKY_ENGINE_WEB_WEBVIEWIMPL_H_ +#include "sky/engine/core/rendering/HitTestResult.h" #include "sky/engine/platform/geometry/IntPoint.h" #include "sky/engine/platform/geometry/IntRect.h" #include "sky/engine/public/platform/WebInputEvent.h" @@ -54,6 +55,7 @@ class Frame; class WebLocalFrameImpl; class WebImage; class WebSettingsImpl; +class Page; class WebViewImpl final : public WebView, public RefCounted { public: @@ -154,13 +156,6 @@ public: // not take the user away from the current page. void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage); - // Indicates two things: - // 1) This view may have a new layout now. - // 2) Calling layout() is a no-op. - // After calling WebWidget::layout(), expect to get this notification - // unless the view did not need a layout. - void layoutUpdated(WebLocalFrameImpl*); - void updateMainFrameLayoutSize(); void scheduleVisualUpdate();