| 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 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3057 } | 3057 } |
| 3058 | 3058 |
| 3059 void RenderViewImpl::didClearWindowObject(WebFrame* frame, int world_id) { | 3059 void RenderViewImpl::didClearWindowObject(WebFrame* frame, int world_id) { |
| 3060 FOR_EACH_OBSERVER(RenderViewObserver, observers_, | 3060 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
| 3061 DidClearWindowObject(frame, world_id)); | 3061 DidClearWindowObject(frame, world_id)); |
| 3062 | 3062 |
| 3063 // Only install controllers into the main world. | 3063 // Only install controllers into the main world. |
| 3064 if (world_id) | 3064 if (world_id) |
| 3065 return; | 3065 return; |
| 3066 | 3066 |
| 3067 if (enabled_bindings_& BINDINGS_POLICY_WEB_UI) |
| 3068 WebUIExtension::Install(frame); |
| 3069 |
| 3067 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) | 3070 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) |
| 3068 DomAutomationController::Install(this, frame); | 3071 DomAutomationController::Install(this, frame); |
| 3069 | 3072 |
| 3070 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) | 3073 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) |
| 3071 StatsCollectionController::Install(frame); | 3074 StatsCollectionController::Install(frame); |
| 3072 | 3075 |
| 3073 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 3076 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 3074 | 3077 |
| 3075 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) | 3078 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) |
| 3076 SkiaBenchmarking::Install(frame); | 3079 SkiaBenchmarking::Install(frame); |
| (...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4092 WebFrame* frame = GetChildFrame(frame_xpath); | 4095 WebFrame* frame = GetChildFrame(frame_xpath); |
| 4093 if (!frame) | 4096 if (!frame) |
| 4094 return; | 4097 return; |
| 4095 | 4098 |
| 4096 frame->document().insertStyleSheet(WebString::fromUTF8(css)); | 4099 frame->document().insertStyleSheet(WebString::fromUTF8(css)); |
| 4097 } | 4100 } |
| 4098 | 4101 |
| 4099 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { | 4102 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { |
| 4100 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && | 4103 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && |
| 4101 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { | 4104 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { |
| 4102 RenderThread::Get()->RegisterExtension(WebUIExtension::Get()); | |
| 4103 new WebUIExtensionData(this); | 4105 new WebUIExtensionData(this); |
| 4104 } | 4106 } |
| 4105 | 4107 |
| 4106 enabled_bindings_ |= enabled_bindings_flags; | 4108 enabled_bindings_ |= enabled_bindings_flags; |
| 4107 | 4109 |
| 4108 // Keep track of the total bindings accumulated in this process. | 4110 // Keep track of the total bindings accumulated in this process. |
| 4109 RenderProcess::current()->AddBindings(enabled_bindings_flags); | 4111 RenderProcess::current()->AddBindings(enabled_bindings_flags); |
| 4110 } | 4112 } |
| 4111 | 4113 |
| 4112 void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data, | 4114 void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data, |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5548 for (size_t i = 0; i < icon_urls.size(); i++) { | 5550 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 5549 WebURL url = icon_urls[i].iconURL(); | 5551 WebURL url = icon_urls[i].iconURL(); |
| 5550 if (!url.isEmpty()) | 5552 if (!url.isEmpty()) |
| 5551 urls.push_back(FaviconURL(url, | 5553 urls.push_back(FaviconURL(url, |
| 5552 ToFaviconType(icon_urls[i].iconType()))); | 5554 ToFaviconType(icon_urls[i].iconType()))); |
| 5553 } | 5555 } |
| 5554 SendUpdateFaviconURL(urls); | 5556 SendUpdateFaviconURL(urls); |
| 5555 } | 5557 } |
| 5556 | 5558 |
| 5557 } // namespace content | 5559 } // namespace content |
| OLD | NEW |