| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |