| 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 #ifndef CHROME_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ | 5 #ifndef CHROME_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ |
| 6 #define CHROME_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ | 6 #define CHROME_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ipc/ipc_channel_proxy.h" | 9 #include "ipc/ipc_channel_proxy.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 | 11 |
| 12 class PluginProcessHost; | 12 class PluginProcessHost; |
| 13 | 13 |
| 14 // This class filters out incoming Chrome-specific IPC messages for the plugin | 14 // This class filters out incoming Chrome-specific IPC messages for the plugin |
| 15 // process on the IPC thread. | 15 // process on the IPC thread. |
| 16 class ChromePluginMessageFilter : public IPC::ChannelProxy::MessageFilter, | 16 class ChromePluginMessageFilter : public IPC::ChannelProxy::MessageFilter, |
| 17 public IPC::Message::Sender { | 17 public IPC::Message::Sender { |
| 18 public: | 18 public: |
| 19 ChromePluginMessageFilter(PluginProcessHost* process); | 19 ChromePluginMessageFilter(PluginProcessHost* process); |
| 20 | 20 |
| 21 // BrowserMessageFilter methods: | 21 // BrowserMessageFilter methods: |
| 22 virtual bool OnMessageReceived(const IPC::Message& message); | 22 virtual bool OnMessageReceived(const IPC::Message& message); |
| 23 | 23 |
| 24 // IPC::Message::Sender methods: | 24 // IPC::Message::Sender methods: |
| 25 virtual bool Send(IPC::Message* message); | 25 virtual bool Send(IPC::Message* message); |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 virtual ~ChromePluginMessageFilter(); | 28 virtual ~ChromePluginMessageFilter(); |
| 29 | 29 |
| 30 #if defined(OS_WIN) | 30 #if defined(OS_WIN) && !defined(USE_AURA) |
| 31 void OnDownloadUrl(const std::string& url, | 31 void OnDownloadUrl(const std::string& url, |
| 32 gfx::NativeWindow caller_window); | 32 gfx::NativeWindow caller_window); |
| 33 // Helper function to issue the download request on the file thread. | 33 // Helper function to issue the download request on the file thread. |
| 34 static void OnDownloadUrlOnFileThread(const std::string& url, | 34 static void OnDownloadUrlOnFileThread(const std::string& url, |
| 35 gfx::NativeWindow caller_window); | 35 gfx::NativeWindow caller_window); |
| 36 #endif | 36 #endif |
| 37 void OnGetPluginFinderUrl(std::string* plugin_finder_url); | 37 void OnGetPluginFinderUrl(std::string* plugin_finder_url); |
| 38 void OnMissingPluginStatus(int status, | 38 void OnMissingPluginStatus(int status, |
| 39 int render_process_id, | 39 int render_process_id, |
| 40 int render_view_id, | 40 int render_view_id, |
| 41 gfx::NativeWindow window); | 41 gfx::NativeWindow window); |
| 42 | 42 |
| 43 // static | 43 // static |
| 44 static void HandleMissingPluginStatus(int status, | 44 static void HandleMissingPluginStatus(int status, |
| 45 int render_process_id, | 45 int render_process_id, |
| 46 int render_view_id, | 46 int render_view_id, |
| 47 gfx::NativeWindow window); | 47 gfx::NativeWindow window); |
| 48 | 48 |
| 49 PluginProcessHost* process_; | 49 PluginProcessHost* process_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(ChromePluginMessageFilter); | 51 DISALLOW_COPY_AND_ASSIGN(ChromePluginMessageFilter); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 #endif // CHROME_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ | 54 #endif // CHROME_BROWSER_CHROME_PLUGIN_MESSAGE_FILTER_H_ |
| OLD | NEW |