#include "chrome/renderer/extensions/resource_request_policy.h"
#include "chrome/renderer/external_extension.h"
#include "chrome/renderer/loadtimes_extension_bindings.h"
+#include "chrome/renderer/media/cast_ipc_dispatcher.h"
#include "chrome/renderer/media/chrome_key_systems.h"
#include "chrome/renderer/net/net_error_helper.h"
#include "chrome/renderer/net/prescient_networking_dispatcher.h"
#include "components/autofill/content/renderer/autofill_agent.h"
#include "components/autofill/content/renderer/password_autofill_agent.h"
#include "components/autofill/content/renderer/password_generation_agent.h"
-#include "components/autofill/core/common/password_generation_util.h"
#include "components/nacl/renderer/ppb_nacl_private_impl.h"
#include "components/plugins/renderer/mobile_youtube_plugin.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "chrome/renderer/spellchecker/spellcheck_provider.h"
#endif
+#if defined(OS_WIN)
+#include "chrome_elf/blacklist/blacklist.h"
+#endif // OS_WIN
+
using autofill::AutofillAgent;
using autofill::PasswordAutofillAgent;
using autofill::PasswordGenerationAgent;
#if defined(ENABLE_WEBRTC)
thread->AddFilter(webrtc_logging_message_filter_.get());
#endif
+ thread->AddFilter(new CastIPCDispatcher(
+ content::RenderThread::Get()->GetIOMessageLoopProxy()));
thread->RegisterExtension(extensions_v8::ExternalExtension::Get());
thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get());
// should not be accessible by normal content, and should also be unable to
// script anything but themselves (to help limit the damage that a corrupt
// page could cause).
- WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme));
+ WebString chrome_ui_scheme(ASCIIToUTF16(content::kChromeUIScheme));
WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme);
WebString chrome_search_scheme(ASCIIToUTF16(chrome::kChromeSearchScheme));
if (!command_line->HasSwitch(switches::kInstantProcess))
WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_search_scheme);
- WebString dev_tools_scheme(ASCIIToUTF16(chrome::kChromeDevToolsScheme));
+ WebString dev_tools_scheme(ASCIIToUTF16(content::kChromeDevToolsScheme));
WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(dev_tools_scheme);
WebString dom_distiller_scheme(ASCIIToUTF16(chrome::kDomDistillerScheme));
extensions::ExtensionsClient::Set(
extensions::ChromeExtensionsClient::GetInstance());
+
+#if defined(OS_WIN)
+ // Report if the renderer process has been patched by chrome_elf.
+ // TODO(csharp): Remove once the renderer is no longer getting
+ // patched this way.
+ typedef bool(*IsBlacklistInitializedFunc)();
+ IsBlacklistInitializedFunc is_blacklist_initialized =
+ reinterpret_cast<IsBlacklistInitializedFunc>(
+ GetProcAddress(GetModuleHandle(L"chrome_elf.dll"),
+ "IsBlacklistInitialized"));
+ if (is_blacklist_initialized && is_blacklist_initialized())
+ UMA_HISTOGRAM_BOOLEAN("Blacklist.PatchedInRenderer", true);
+#endif
}
void ChromeContentRendererClient::RenderFrameCreated(
new prerender::PrerenderHelper(render_frame);
}
}
+
+ if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) {
+ // Only attach NetErrorHelper to the main frame, since only the main frame
+ // should get error pages.
+ new NetErrorHelper(render_frame);
+ }
}
void ChromeContentRendererClient::RenderViewCreated(
safe_browsing::MalwareDOMDetails::Create(render_view);
#endif
+ PasswordGenerationAgent* password_generation_agent =
+ new PasswordGenerationAgent(render_view);
PasswordAutofillAgent* password_autofill_agent =
new PasswordAutofillAgent(render_view);
- new AutofillAgent(render_view, password_autofill_agent);
+ new AutofillAgent(render_view,
+ password_autofill_agent,
+ password_generation_agent);
CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (autofill::password_generation::IsPasswordGenerationEnabled())
- new PasswordGenerationAgent(render_view);
if (command_line->HasSwitch(switches::kInstantProcess))
new SearchBox(render_view);
new ChromeRenderViewObserver(render_view, chrome_observer_.get());
-
- new NetErrorHelper(render_view);
}
void ChromeContentRendererClient::SetNumberOfViews(int number_of_views) {
status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed;
}
-#if defined(USE_AURA) && defined(OS_WIN)
- // In Aura for Windows we need to check if we can load NPAPI plugins.
+#if defined(OS_WIN)
+ // In Windows we need to check if we can load NPAPI plugins.
// For example, if the render view is in the Ash desktop, we should not.
if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed &&
plugin.type == content::WebPluginInfo::PLUGIN_TYPE_NPAPI) {
"t");
}
} else {
- NetErrorHelper* helper = NetErrorHelper::Get(render_view);
+ // TODO(ellyjones): change GetNavigationErrorStrings to take a RenderFrame
+ // instead of a RenderView, then pass that in.
+ // This is safe for now because we only install the NetErrorHelper on the
+ // main render frame anyway; see the TODO(ellyjones) in
+ // RenderFrameCreated.
+ content::RenderFrame* main_render_frame =
+ render_view->GetMainRenderFrame();
+ NetErrorHelper* helper = NetErrorHelper::Get(main_render_frame);
helper->GetErrorHTML(frame, error, is_post, error_html);
}
}