Commit 8c44726b authored by dcheng@chromium.org's avatar dcheng@chromium.org

Move addStylesheetByURL from WebFrame to WebLocalFrame.

There's no reason this would ever be called on remote frames.

BUG=386340

Review URL: https://codereview.chromium.org/340213002

git-svn-id: svn://svn.chromium.org/blink/trunk@176486 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 70d328d9
......@@ -1323,17 +1323,6 @@ void WebLocalFrameImpl::extendSelectionAndDelete(int before, int after)
frame()->inputMethodController().extendSelectionAndDelete(before, after);
}
void WebLocalFrameImpl::addStyleSheetByURL(const WebString& url)
{
RefPtrWillBeRawPtr<Element> styleElement = frame()->document()->createElement(HTMLNames::linkTag, false);
styleElement->setAttribute(HTMLNames::typeAttr, "text/css");
styleElement->setAttribute(HTMLNames::relAttr, "stylesheet");
styleElement->setAttribute(HTMLNames::hrefAttr, url);
frame()->document()->head()->appendChild(styleElement.release(), IGNORE_EXCEPTION);
}
void WebLocalFrameImpl::setCaretVisible(bool visible)
{
frame()->selection().setCaretVisible(visible);
......@@ -1890,6 +1879,17 @@ void WebLocalFrameImpl::loadJavaScriptURL(const KURL& url)
frame()->document()->loader()->replaceDocument(scriptResult, ownerDocument.get());
}
void WebLocalFrameImpl::addStyleSheetByURL(const WebString& url)
{
RefPtrWillBeRawPtr<Element> styleElement = frame()->document()->createElement(HTMLNames::linkTag, false);
styleElement->setAttribute(HTMLNames::typeAttr, "text/css");
styleElement->setAttribute(HTMLNames::relAttr, "stylesheet");
styleElement->setAttribute(HTMLNames::hrefAttr, url);
frame()->document()->head()->appendChild(styleElement.release(), IGNORE_EXCEPTION);
}
void WebLocalFrameImpl::willDetachParent()
{
// Do not expect string scoping results from any frames that got detached
......
......@@ -183,7 +183,6 @@ public:
virtual bool setEditableSelectionOffsets(int start, int end) OVERRIDE;
virtual bool setCompositionFromExistingText(int compositionStart, int compositionEnd, const WebVector<WebCompositionUnderline>& underlines) OVERRIDE;
virtual void extendSelectionAndDelete(int before, int after) OVERRIDE;
virtual void addStyleSheetByURL(const WebString& url) OVERRIDE;
virtual void setCaretVisible(bool) OVERRIDE;
virtual int printBegin(const WebPrintParams&, const WebNode& constrainToNode) OVERRIDE;
virtual float printPage(int pageToPrint, WebCanvas*) OVERRIDE;
......@@ -232,6 +231,9 @@ public:
virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const OVERRIDE;
virtual WebString layerTreeAsText(bool showDebugInfo = false) const OVERRIDE;
// WebLocalFrame methods:
virtual void addStyleSheetByURL(const WebString& url) OVERRIDE;
void willDetachParent();
static WebLocalFrameImpl* create(WebFrameClient*);
......
......@@ -615,11 +615,6 @@ void WebRemoteFrameImpl::extendSelectionAndDelete(int before, int after)
ASSERT_NOT_REACHED();
}
void WebRemoteFrameImpl::addStyleSheetByURL(const WebString& url)
{
ASSERT_NOT_REACHED();
}
void WebRemoteFrameImpl::setCaretVisible(bool)
{
ASSERT_NOT_REACHED();
......
......@@ -128,7 +128,6 @@ public:
virtual bool setEditableSelectionOffsets(int start, int end) OVERRIDE;
virtual bool setCompositionFromExistingText(int compositionStart, int compositionEnd, const WebVector<WebCompositionUnderline>& underlines) OVERRIDE;
virtual void extendSelectionAndDelete(int before, int after) OVERRIDE;
virtual void addStyleSheetByURL(const WebString& url) OVERRIDE;
virtual void setCaretVisible(bool) OVERRIDE;
virtual int printBegin(const WebPrintParams&, const WebNode& constrainToNode) OVERRIDE;
virtual float printPage(int pageToPrint, WebCanvas*) OVERRIDE;
......
......@@ -472,10 +472,6 @@ public:
virtual void setCaretVisible(bool) = 0;
// Navigation Transitions ---------------------------------------------
virtual void addStyleSheetByURL(const WebString& url) = 0;
// Printing ------------------------------------------------------------
// Reformats the WebFrame for printing. WebPrintParams specifies the printable
......
......@@ -31,6 +31,9 @@ public:
// Returns the frame inside a given frame or iframe element. Returns 0 if
// the given element is not a frame, iframe or if the frame is empty.
BLINK_EXPORT static WebLocalFrame* fromFrameOwnerElement(const WebElement&);
// Navigation Transitions ---------------------------------------------
virtual void addStyleSheetByURL(const WebString& url) = 0;
};
} // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment