| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2688 } | 2688 } |
| 2689 } | 2689 } |
| 2690 // Check for Native Client modules. | 2690 // Check for Native Client modules. |
| 2691 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl)) { | 2691 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl)) { |
| 2692 if (mime_type == "application/x-nacl-srpc") { | 2692 if (mime_type == "application/x-nacl-srpc") { |
| 2693 in_process_plugin = true; | 2693 in_process_plugin = true; |
| 2694 use_pepper_host = true; | 2694 use_pepper_host = true; |
| 2695 } | 2695 } |
| 2696 } | 2696 } |
| 2697 if (in_process_plugin) { | 2697 if (in_process_plugin) { |
| 2698 #if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac. | 2698 #if defined(OS_WIN) // In-proc plugins aren't supported on Linux. |
| 2699 if (use_pepper_host) { | 2699 if (use_pepper_host) { |
| 2700 return WebPluginDelegatePepper::Create( | 2700 return WebPluginDelegatePepper::Create( |
| 2701 path, | 2701 path, |
| 2702 *mime_type_to_use, | 2702 *mime_type_to_use, |
| 2703 AsWeakPtr(), | 2703 AsWeakPtr(), |
| 2704 gfx::NativeViewFromId(host_window_)); | 2704 gfx::NativeViewFromId(host_window_)); |
| 2705 } else { | 2705 } else { |
| 2706 return WebPluginDelegateImpl::Create( | 2706 return WebPluginDelegateImpl::Create( |
| 2707 path, *mime_type_to_use, gfx::NativeViewFromId(host_window_)); | 2707 path, *mime_type_to_use, gfx::NativeViewFromId(host_window_)); |
| 2708 } | 2708 } |
| 2709 #elif defined(OS_MACOSX) |
| 2710 if (use_pepper_host) { |
| 2711 return WebPluginDelegatePepper::Create( |
| 2712 path, |
| 2713 *mime_type_to_use, |
| 2714 AsWeakPtr(), |
| 2715 host_window_); |
| 2716 } else { |
| 2717 NOTIMPLEMENTED(); |
| 2718 return NULL; |
| 2719 } |
| 2709 #else | 2720 #else |
| 2710 NOTIMPLEMENTED(); | 2721 NOTIMPLEMENTED(); |
| 2711 return NULL; | 2722 return NULL; |
| 2712 #endif | 2723 #endif |
| 2713 } | 2724 } |
| 2714 | 2725 |
| 2715 return new WebPluginDelegateProxy(*mime_type_to_use, AsWeakPtr()); | 2726 return new WebPluginDelegateProxy(*mime_type_to_use, AsWeakPtr()); |
| 2716 } | 2727 } |
| 2717 | 2728 |
| 2718 void RenderView::CreatedPluginWindow(gfx::PluginWindowHandle window) { | 2729 void RenderView::CreatedPluginWindow(gfx::PluginWindowHandle window) { |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3986 | 3997 |
| 3987 message->EnableMessagePumping(); // Runs a nested message loop. | 3998 message->EnableMessagePumping(); // Runs a nested message loop. |
| 3988 bool rv = Send(message); | 3999 bool rv = Send(message); |
| 3989 | 4000 |
| 3990 PluginChannelHost::Broadcast( | 4001 PluginChannelHost::Broadcast( |
| 3991 new PluginMsg_ResetModalDialogEvent(host_window_)); | 4002 new PluginMsg_ResetModalDialogEvent(host_window_)); |
| 3992 | 4003 |
| 3993 return rv; | 4004 return rv; |
| 3994 } | 4005 } |
| 3995 | 4006 |
| OLD | NEW |