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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view.h" 5 #include "content/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3367 matching lines...) Expand 10 before | Expand all | Expand 10 after
3378 } 3378 }
3379 3379
3380 void RenderView::OnScriptEvalRequest(const string16& frame_xpath, 3380 void RenderView::OnScriptEvalRequest(const string16& frame_xpath,
3381 const string16& jscript, 3381 const string16& jscript,
3382 int id, 3382 int id,
3383 bool notify_result) { 3383 bool notify_result) {
3384 EvaluateScript(frame_xpath, jscript, id, notify_result); 3384 EvaluateScript(frame_xpath, jscript, id, notify_result);
3385 } 3385 }
3386 3386
3387 void RenderView::OnCSSInsertRequest(const std::wstring& frame_xpath, 3387 void RenderView::OnCSSInsertRequest(const std::wstring& frame_xpath,
3388 const std::string& css, 3388 const std::string& css) {
3389 const std::string& id) {
3390 WebFrame* frame = GetChildFrame(frame_xpath); 3389 WebFrame* frame = GetChildFrame(frame_xpath);
3391 if (!frame) 3390 if (!frame)
3392 return; 3391 return;
3393 3392
3394 frame->document().insertStyleText(WebString::fromUTF8(css), 3393 frame->document().insertUserStyleSheet(
3395 WebString::fromUTF8(id)); 3394 WebString::fromUTF8(css),
3395 WebDocument::UserStyleAuthorLevel);
3396 } 3396 }
3397 3397
3398 void RenderView::OnAllowBindings(int enabled_bindings_flags) { 3398 void RenderView::OnAllowBindings(int enabled_bindings_flags) {
3399 enabled_bindings_ |= enabled_bindings_flags; 3399 enabled_bindings_ |= enabled_bindings_flags;
3400 } 3400 }
3401 3401
3402 void RenderView::OnSetWebUIProperty(const std::string& name, 3402 void RenderView::OnSetWebUIProperty(const std::string& name,
3403 const std::string& value) { 3403 const std::string& value) {
3404 DCHECK(BindingsPolicy::is_web_ui_enabled(enabled_bindings_)); 3404 DCHECK(BindingsPolicy::is_web_ui_enabled(enabled_bindings_));
3405 GetWebUIBindings()->SetProperty(name, value); 3405 GetWebUIBindings()->SetProperty(name, value);
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
4389 } 4389 }
4390 #endif 4390 #endif
4391 4391
4392 void RenderView::OnContextMenuClosed( 4392 void RenderView::OnContextMenuClosed(
4393 const webkit_glue::CustomContextMenuContext& custom_context) { 4393 const webkit_glue::CustomContextMenuContext& custom_context) {
4394 if (custom_context.is_pepper_menu) 4394 if (custom_context.is_pepper_menu)
4395 pepper_delegate_.OnContextMenuClosed(custom_context); 4395 pepper_delegate_.OnContextMenuClosed(custom_context);
4396 else 4396 else
4397 context_menu_node_.reset(); 4397 context_menu_node_.reset();
4398 } 4398 }
OLDNEW
« 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