OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chrome_plugin_message_filter.h" | 5 #include "chrome/browser/chrome_plugin_message_filter.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/infobars/infobar_tab_helper.h" | 8 #include "chrome/browser/infobars/infobar_tab_helper.h" |
9 #include "chrome/browser/plugin_download_helper.h" | 9 #include "chrome/browser/plugin_download_helper.h" |
10 #include "chrome/browser/plugin_installer_infobar_delegate.h" | 10 #include "chrome/browser/plugin_installer_infobar_delegate.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 ChromePluginMessageFilter::ChromePluginMessageFilter(PluginProcessHost* process) | 25 ChromePluginMessageFilter::ChromePluginMessageFilter(PluginProcessHost* process) |
26 : process_(process) { | 26 : process_(process) { |
27 } | 27 } |
28 | 28 |
29 ChromePluginMessageFilter::~ChromePluginMessageFilter() { | 29 ChromePluginMessageFilter::~ChromePluginMessageFilter() { |
30 } | 30 } |
31 | 31 |
32 bool ChromePluginMessageFilter::OnMessageReceived(const IPC::Message& message) { | 32 bool ChromePluginMessageFilter::OnMessageReceived(const IPC::Message& message) { |
33 bool handled = true; | 33 bool handled = true; |
34 IPC_BEGIN_MESSAGE_MAP(ChromePluginMessageFilter, message) | 34 IPC_BEGIN_MESSAGE_MAP(ChromePluginMessageFilter, message) |
35 #if defined(OS_WIN) | 35 #if defined(OS_WIN) && !defined(USE_AURA) |
36 IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_DownloadUrl, OnDownloadUrl) | 36 IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_DownloadUrl, OnDownloadUrl) |
37 #endif | 37 #endif |
38 IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_GetPluginFinderUrl, | 38 IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_GetPluginFinderUrl, |
39 OnGetPluginFinderUrl) | 39 OnGetPluginFinderUrl) |
40 IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_MissingPluginStatus, | 40 IPC_MESSAGE_HANDLER(ChromePluginProcessHostMsg_MissingPluginStatus, |
41 OnMissingPluginStatus) | 41 OnMissingPluginStatus) |
42 IPC_MESSAGE_UNHANDLED(handled = false) | 42 IPC_MESSAGE_UNHANDLED(handled = false) |
43 IPC_END_MESSAGE_MAP() | 43 IPC_END_MESSAGE_MAP() |
44 | 44 |
45 return handled; | 45 return handled; |
46 } | 46 } |
47 | 47 |
48 bool ChromePluginMessageFilter::Send(IPC::Message* message) { | 48 bool ChromePluginMessageFilter::Send(IPC::Message* message) { |
49 return process_->Send(message); | 49 return process_->Send(message); |
50 } | 50 } |
51 | 51 |
52 #if defined(OS_WIN) | 52 #if defined(OS_WIN) && !defined(USE_AURA) |
53 void ChromePluginMessageFilter::OnDownloadUrl(const std::string& url, | 53 void ChromePluginMessageFilter::OnDownloadUrl(const std::string& url, |
54 gfx::NativeWindow caller_window) { | 54 gfx::NativeWindow caller_window) { |
55 BrowserThread::PostTask( | 55 BrowserThread::PostTask( |
56 BrowserThread::FILE, FROM_HERE, | 56 BrowserThread::FILE, FROM_HERE, |
57 NewRunnableFunction(OnDownloadUrlOnFileThread, url, caller_window)); | 57 NewRunnableFunction(OnDownloadUrlOnFileThread, url, caller_window)); |
58 } | 58 } |
59 | 59 |
60 void ChromePluginMessageFilter::OnDownloadUrlOnFileThread( | 60 void ChromePluginMessageFilter::OnDownloadUrlOnFileThread( |
61 const std::string& url, | 61 const std::string& url, |
62 gfx::NativeWindow caller_window) { | 62 gfx::NativeWindow caller_window) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 return; | 125 return; |
126 } | 126 } |
127 } | 127 } |
128 #else | 128 #else |
129 // TODO(port): Implement the infobar that accompanies the default plugin. | 129 // TODO(port): Implement the infobar that accompanies the default plugin. |
130 // Linux: http://crbug.com/10952 | 130 // Linux: http://crbug.com/10952 |
131 // Mac: http://crbug.com/17392 | 131 // Mac: http://crbug.com/17392 |
132 NOTIMPLEMENTED(); | 132 NOTIMPLEMENTED(); |
133 #endif // OS_WIN | 133 #endif // OS_WIN |
134 } | 134 } |
OLD | NEW |