Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1543)

Unified Diff: content/renderer/render_view.cc

Issue 7517001: Switch from WebDocument::insertStyleText to ::insertUserStyleSheet for programatic CSS injection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebaseline Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view.cc
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index d0f09c703dba14c6bb62ff57a311adcc066ab4d2..1fa51521701bac7de29ac188f51a620714d904ea 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -3385,14 +3385,14 @@ void RenderView::OnScriptEvalRequest(const string16& frame_xpath,
}
void RenderView::OnCSSInsertRequest(const std::wstring& frame_xpath,
- const std::string& css,
- const std::string& id) {
+ const std::string& css) {
WebFrame* frame = GetChildFrame(frame_xpath);
if (!frame)
return;
- frame->document().insertStyleText(WebString::fromUTF8(css),
- WebString::fromUTF8(id));
+ frame->document().insertUserStyleSheet(
+ WebString::fromUTF8(css),
+ WebDocument::UserStyleAuthorLevel);
}
void RenderView::OnAllowBindings(int enabled_bindings_flags) {
« no previous file with comments | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698