summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorsimonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 23:23:39 +0000
committersimonhatch@chromium.org <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 23:23:39 +0000
commit2e531f7c26d0d9e2aa0cced17a35eea6687dc58c (patch)
treed281910bf70bfb0c0265d99a4188bcf1026ff329 /content/renderer
parenta93606e6df31e9ca439cd39954d861d6dafd4a86 (diff)
downloadchromium_src-2e531f7c26d0d9e2aa0cced17a35eea6687dc58c.zip
chromium_src-2e531f7c26d0d9e2aa0cced17a35eea6687dc58c.tar.gz
chromium_src-2e531f7c26d0d9e2aa0cced17a35eea6687dc58c.tar.bz2
Navigation transitions: Added "addStyleSheetByURL" function to insert stylesheet links.
If transition-entering-stylesheet is defined in the response headers for the incoming document, they're parsed out, passed to the TransitionPageHelper in the embedder, and are applied to the page via addStyleSheetByUrl at the appropriate time in the transition. This is the chrome side of the CL, blink side here: https://codereview.chromium.org/285623003/ Design doc: https://docs.google.com/a/chromium.org/document/d/17jg1RRL3RI969cLwbKBIcoGDsPwqaEdBxafGNYGwiY4/edit# Implementation details: https://docs.google.com/a/chromium.org/document/d/1kREPtFJaeLoDKwrfmrYTD7DHCdxX1RzFBga2gNY8lyE/edit#heading=h.bng2kpmyvxq5 BUG=370696 Review URL: https://codereview.chromium.org/309143002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/render_frame_impl.cc6
-rw-r--r--content/renderer/render_frame_impl.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 8636b6e..335bd75 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -710,6 +710,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload)
IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest,
OnTextSurroundingSelectionRequest)
+ IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL,
+ OnAddStyleSheetByURL)
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard)
#endif
@@ -1177,6 +1179,10 @@ void RenderFrameImpl::OnTextSurroundingSelectionRequest(size_t max_length) {
surroundingText.endOffsetInTextContent()));
}
+void RenderFrameImpl::OnAddStyleSheetByURL(const std::string& url) {
+ frame_->addStyleSheetByURL(WebString::fromUTF8(url));
+}
+
bool RenderFrameImpl::ShouldUpdateSelectionTextFromContextMenuParams(
const base::string16& selection_text,
size_t selection_text_offset,
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 97cd4eb..71be416 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -458,6 +458,7 @@ class CONTENT_EXPORT RenderFrameImpl
void OnExtendSelectionAndDelete(int before, int after);
void OnReload(bool ignore_cache);
void OnTextSurroundingSelectionRequest(size_t max_length);
+ void OnAddStyleSheetByURL(const std::string& url);
#if defined(OS_MACOSX)
void OnCopyToFindPboard();
#endif