summaryrefslogtreecommitdiffstats
path: root/chrome/default_plugin
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 22:36:18 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 22:36:18 +0000
commitcdc89119701e2f3f115016faa772ecddbb4025d4 (patch)
treebc0afb76688cf21ae237f280ba1470753600524c /chrome/default_plugin
parent130dee6eb86395c0541a342c8e0c7cf47e8b9b07 (diff)
downloadchromium_src-cdc89119701e2f3f115016faa772ecddbb4025d4.zip
chromium_src-cdc89119701e2f3f115016faa772ecddbb4025d4.tar.gz
chromium_src-cdc89119701e2f3f115016faa772ecddbb4025d4.tar.bz2
Part 1 of changes to to build chrome\common as a dll. Moving some of the functionality provided by plugin_thread.cc
to the default_plugin which is the only caller. Removed the unused AppendToLog function from the webkit_glue namespace. BUG=82326 Review URL: http://codereview.chromium.org/7012004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85202 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/default_plugin')
-rw-r--r--chrome/default_plugin/plugin_impl_win.cc31
1 files changed, 29 insertions, 2 deletions
diff --git a/chrome/default_plugin/plugin_impl_win.cc b/chrome/default_plugin/plugin_impl_win.cc
index c6ef4c6..8a2f3e3 100644
--- a/chrome/default_plugin/plugin_impl_win.cc
+++ b/chrome/default_plugin/plugin_impl_win.cc
@@ -11,14 +11,41 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/default_plugin/plugin_main.h"
+#include "content/common/child_thread.h"
+#include "content/common/plugin_messages.h"
#include "googleurl/src/gurl.h"
#include "grit/webkit_strings.h"
+#include "net/base/net_errors.h"
#include "unicode/locid.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/plugins/npapi/default_plugin_shared.h"
static const int TOOLTIP_MAX_WIDTH = 500;
+namespace {
+
+bool GetPluginFinderURL(std::string* plugin_finder_url) {
+ if (!plugin_finder_url) {
+ NOTREACHED();
+ return false;
+ }
+
+ ChildThread::current()->Send(
+ new PluginProcessHostMsg_GetPluginFinderUrl(plugin_finder_url));
+ // If we get an empty string back this means the plugin finder has been
+ // disabled.
+ return true;
+}
+
+bool DownloadUrl(const std::string& url, HWND caller_window) {
+ return ChildThread::current()->Send(
+ new PluginProcessHostMsg_DownloadUrl(MSG_ROUTING_NONE, url,
+ ::GetCurrentProcessId(),
+ caller_window));
+}
+
+}
+
PluginInstallerImpl::PluginInstallerImpl(int16 mode)
: instance_(NULL),
mode_(mode),
@@ -67,7 +94,7 @@ bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance,
instance_ = instance;
mime_type_ = mime_type;
- if (!webkit_glue::GetPluginFinderURL(&plugin_finder_url_)) {
+ if (!GetPluginFinderURL(&plugin_finder_url_)) {
NOTREACHED() << __FUNCTION__ << " Failed to get the plugin finder URL";
return false;
}
@@ -341,7 +368,7 @@ void PluginInstallerImpl::DownloadPlugin() {
DisplayStatus(IDS_DEFAULT_PLUGIN_DOWNLOADING_PLUGIN_MSG);
if (!plugin_download_url_for_display_) {
- webkit_glue::DownloadUrl(plugin_download_url_, hwnd());
+ DownloadUrl(plugin_download_url_, hwnd());
} else {
default_plugin::g_browser->geturl(instance(),
plugin_download_url_.c_str(),