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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 154113008: Switch from WebDocument::insertUserStyleSheet() to insertStyleSheet(). (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: split line Created 6 years, 10 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
« no previous file with comments | « chrome/renderer/extensions/user_script_scheduler.cc ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 4597 matching lines...) Expand 10 before | Expand all | Expand 10 after
4608 } 4608 }
4609 frame->dispatchMessageEventWithOriginCheck(target_origin, msg_event); 4609 frame->dispatchMessageEventWithOriginCheck(target_origin, msg_event);
4610 } 4610 }
4611 4611
4612 void RenderViewImpl::OnCSSInsertRequest(const base::string16& frame_xpath, 4612 void RenderViewImpl::OnCSSInsertRequest(const base::string16& frame_xpath,
4613 const std::string& css) { 4613 const std::string& css) {
4614 WebFrame* frame = GetChildFrame(frame_xpath); 4614 WebFrame* frame = GetChildFrame(frame_xpath);
4615 if (!frame) 4615 if (!frame)
4616 return; 4616 return;
4617 4617
4618 frame->document().insertUserStyleSheet( 4618 frame->document().insertStyleSheet(WebString::fromUTF8(css));
4619 WebString::fromUTF8(css),
4620 WebDocument::UserStyleAuthorLevel);
4621 } 4619 }
4622 4620
4623 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { 4621 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) {
4624 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && 4622 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) &&
4625 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { 4623 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) {
4626 // WebUI uses <dialog> which is not yet enabled by default in Chrome. 4624 // WebUI uses <dialog> which is not yet enabled by default in Chrome.
4627 WebRuntimeFeatures::enableDialogElement(true); 4625 WebRuntimeFeatures::enableDialogElement(true);
4628 4626
4629 RenderThread::Get()->RegisterExtension(WebUIExtension::Get()); 4627 RenderThread::Get()->RegisterExtension(WebUIExtension::Get());
4630 new WebUIExtensionData(this); 4628 new WebUIExtensionData(this);
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
6069 for (size_t i = 0; i < icon_urls.size(); i++) { 6067 for (size_t i = 0; i < icon_urls.size(); i++) {
6070 WebURL url = icon_urls[i].iconURL(); 6068 WebURL url = icon_urls[i].iconURL();
6071 if (!url.isEmpty()) 6069 if (!url.isEmpty())
6072 urls.push_back(FaviconURL(url, 6070 urls.push_back(FaviconURL(url,
6073 ToFaviconType(icon_urls[i].iconType()))); 6071 ToFaviconType(icon_urls[i].iconType())));
6074 } 6072 }
6075 SendUpdateFaviconURL(urls); 6073 SendUpdateFaviconURL(urls);
6076 } 6074 }
6077 6075
6078 } // namespace content 6076 } // namespace content
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/user_script_scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698