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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 113637: Wire up windowless plugins. Mostly Mac related, some cross (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/plugin/webplugin_proxy.cc ('k') | chrome/renderer/webplugin_delegate_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 activatable); 1755 activatable);
1756 return widget->webwidget(); 1756 return widget->webwidget();
1757 } 1757 }
1758 1758
1759 WebPluginDelegate* RenderView::CreatePluginDelegate( 1759 WebPluginDelegate* RenderView::CreatePluginDelegate(
1760 WebView* webview, 1760 WebView* webview,
1761 const GURL& url, 1761 const GURL& url,
1762 const std::string& mime_type, 1762 const std::string& mime_type,
1763 const std::string& clsid, 1763 const std::string& clsid,
1764 std::string* actual_mime_type) { 1764 std::string* actual_mime_type) {
1765 #if defined(OS_WIN) || defined(OS_LINUX)
1766 if (!PluginChannelHost::IsListening()) 1765 if (!PluginChannelHost::IsListening())
1767 return NULL; 1766 return NULL;
1768 1767
1769 GURL policy_url; 1768 GURL policy_url;
1770 if (webview->GetMainFrame()) 1769 if (webview->GetMainFrame())
1771 policy_url = webview->GetMainFrame()->GetURL(); 1770 policy_url = webview->GetMainFrame()->GetURL();
1772 1771
1773 FilePath path; 1772 FilePath path;
1774 render_thread_->Send( 1773 render_thread_->Send(
1775 new ViewHostMsg_GetPluginPath(url, policy_url, mime_type, clsid, &path, 1774 new ViewHostMsg_GetPluginPath(url, policy_url, mime_type, clsid, &path,
1776 actual_mime_type)); 1775 actual_mime_type));
1777 if (path.value().empty()) 1776 if (path.value().empty())
1778 return NULL; 1777 return NULL;
1779 1778
1780 std::string mime_type_to_use; 1779 std::string mime_type_to_use;
1781 if (!actual_mime_type->empty()) 1780 if (!actual_mime_type->empty())
1782 mime_type_to_use = *actual_mime_type; 1781 mime_type_to_use = *actual_mime_type;
1783 else 1782 else
1784 mime_type_to_use = mime_type; 1783 mime_type_to_use = mime_type;
1785 1784
1786 #if !defined(OS_LINUX) // In-proc plugins aren't supported on Linux.
1787 if (RenderProcess::current()->in_process_plugins()) { 1785 if (RenderProcess::current()->in_process_plugins()) {
1786 #if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac.
1788 return WebPluginDelegate::Create(path, 1787 return WebPluginDelegate::Create(path,
1789 mime_type_to_use, 1788 mime_type_to_use,
1790 gfx::NativeViewFromId(host_window_)); 1789 gfx::NativeViewFromId(host_window_));
1790 #else
1791 NOTIMPLEMENTED();
1792 return NULL;
1793 #endif
1791 } 1794 }
1792 #endif
1793 1795
1794 WebPluginDelegateProxy* proxy = 1796 WebPluginDelegateProxy* proxy =
1795 WebPluginDelegateProxy::Create(url, mime_type_to_use, clsid, this); 1797 WebPluginDelegateProxy::Create(url, mime_type_to_use, clsid, this);
1796 if (!proxy) 1798 if (!proxy)
1797 return NULL; 1799 return NULL;
1798 1800
1799 plugin_delegates_.push_back(proxy); 1801 plugin_delegates_.push_back(proxy);
1800 1802
1801 return proxy; 1803 return proxy;
1802 #else
1803 // TODO(port): Plugins currently not supported
1804 NOTIMPLEMENTED();
1805 return NULL;
1806 #endif
1807 } 1804 }
1808 1805
1809 WebKit::WebMediaPlayer* RenderView::CreateWebMediaPlayer( 1806 WebKit::WebMediaPlayer* RenderView::CreateWebMediaPlayer(
1810 WebKit::WebMediaPlayerClient* client) { 1807 WebKit::WebMediaPlayerClient* client) {
1811 scoped_refptr<media::FilterFactoryCollection> factory = 1808 scoped_refptr<media::FilterFactoryCollection> factory =
1812 new media::FilterFactoryCollection(); 1809 new media::FilterFactoryCollection();
1813 // Add in any custom filter factories first. 1810 // Add in any custom filter factories first.
1814 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 1811 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
1815 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { 1812 if (!cmd_line->HasSwitch(switches::kDisableAudio)) {
1816 // Add the chrome specific audio renderer. 1813 // Add the chrome specific audio renderer.
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); 3010 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms));
3014 } 3011 }
3015 3012
3016 void RenderView::Print(WebFrame* frame, bool script_initiated) { 3013 void RenderView::Print(WebFrame* frame, bool script_initiated) {
3017 DCHECK(frame); 3014 DCHECK(frame);
3018 if (print_helper_.get() == NULL) { 3015 if (print_helper_.get() == NULL) {
3019 print_helper_.reset(new PrintWebViewHelper(this)); 3016 print_helper_.reset(new PrintWebViewHelper(this));
3020 } 3017 }
3021 print_helper_->Print(frame, script_initiated); 3018 print_helper_->Print(frame, script_initiated);
3022 } 3019 }
OLDNEW
« no previous file with comments | « chrome/plugin/webplugin_proxy.cc ('k') | chrome/renderer/webplugin_delegate_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698