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

Unified Diff: chrome/browser/chrome_plugin_message_filter.cc

Issue 7036025: Get rid of chrome dependencies from PluginProcessHost by moving dispatching of chrome specific me... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_plugin_message_filter.h ('k') | chrome/browser/net/resolve_proxy_msg_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_plugin_message_filter.cc
===================================================================
--- chrome/browser/chrome_plugin_message_filter.cc (revision 0)
+++ chrome/browser/chrome_plugin_message_filter.cc (revision 0)
@@ -0,0 +1,63 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chrome_plugin_message_filter.h"
+
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/plugin_download_helper.h"
+#include "chrome/browser/profiles/profile.h"
+#include "content/browser/plugin_process_host.h"
+#include "content/common/plugin_messages.h"
+#include "net/url_request/url_request_context_getter.h"
+
+static const char kDefaultPluginFinderURL[] =
+ "https://dl-ssl.google.com/edgedl/chrome/plugins/plugins2.xml";
+
+ChromePluginMessageFilter::ChromePluginMessageFilter(PluginProcessHost* process)
+ : process_(process) {
+}
+
+ChromePluginMessageFilter::~ChromePluginMessageFilter() {
+}
+
+bool ChromePluginMessageFilter::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(ChromePluginMessageFilter, message)
+#if defined(OS_WIN)
+ IPC_MESSAGE_HANDLER(PluginProcessHostMsg_DownloadUrl, OnDownloadUrl)
+#endif
+ IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetPluginFinderUrl,
+ OnGetPluginFinderUrl)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+
+ return handled;
+}
+
+bool ChromePluginMessageFilter::Send(IPC::Message* message) {
+ return process_->Send(message);
+}
+
+#if defined(OS_WIN)
+void ChromePluginMessageFilter::OnDownloadUrl(const std::string& url,
+ int source_pid,
+ gfx::NativeWindow caller_window) {
+ PluginDownloadUrlHelper* download_url_helper =
+ new PluginDownloadUrlHelper(url, source_pid, caller_window, NULL);
+ download_url_helper->InitiateDownload(
+ Profile::GetDefaultRequestContext()->GetURLRequestContext());
+}
+#endif
+
+void ChromePluginMessageFilter::OnGetPluginFinderUrl(
+ std::string* plugin_finder_url) {
+ // TODO(bauerb): Move this method to MessageFilter.
+ if (!g_browser_process->plugin_finder_disabled()) {
+ // TODO(iyengar): Add the plumbing to retrieve the default
+ // plugin finder URL.
+ *plugin_finder_url = kDefaultPluginFinderURL;
+ } else {
+ plugin_finder_url->clear();
+ }
+}
Property changes on: chrome\browser\chrome_plugin_message_filter.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/chrome_plugin_message_filter.h ('k') | chrome/browser/net/resolve_proxy_msg_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698