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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 376033002: Adding MimeHandlerView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pending-zork-patch2
Patch Set: address comments Created 6 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 const blink::WebPluginParams& params) { 1519 const blink::WebPluginParams& params) {
1520 DCHECK_EQ(frame_, frame); 1520 DCHECK_EQ(frame_, frame);
1521 blink::WebPlugin* plugin = NULL; 1521 blink::WebPlugin* plugin = NULL;
1522 if (GetContentClient()->renderer()->OverrideCreatePlugin( 1522 if (GetContentClient()->renderer()->OverrideCreatePlugin(
1523 this, frame, params, &plugin)) { 1523 this, frame, params, &plugin)) {
1524 return plugin; 1524 return plugin;
1525 } 1525 }
1526 1526
1527 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { 1527 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) {
1528 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( 1528 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin(
1529 render_view_.get(), frame, false); 1529 render_view_.get(), frame, NULL);
Ken Rockot(use gerrit already) 2014/09/04 00:57:43 Of course it gets a little annoying to write make_
lazyboy 2014/09/04 18:59:33 Done.
1530 } 1530 }
1531 1531
1532 #if defined(ENABLE_PLUGINS) 1532 #if defined(ENABLE_PLUGINS)
1533 WebPluginInfo info; 1533 WebPluginInfo info;
1534 std::string mime_type; 1534 std::string mime_type;
1535 bool found = false; 1535 bool found = false;
1536 Send(new FrameHostMsg_GetPluginInfo( 1536 Send(new FrameHostMsg_GetPluginInfo(
1537 routing_id_, params.url, frame->top()->document().url(), 1537 routing_id_, params.url, frame->top()->document().url(),
1538 params.mimeType.utf8(), &found, &info, &mime_type)); 1538 params.mimeType.utf8(), &found, &info, &mime_type));
1539 if (!found) 1539 if (!found)
1540 return NULL; 1540 return NULL;
1541 1541
1542 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { 1542 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) {
1543 BrowserPluginDelegate* browser_plugin_delegate =
1544 GetContentClient()->renderer()->CreateBrowserPluginDelegate(
1545 this, base::UTF16ToUTF8(params.mimeType));
1543 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( 1546 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin(
1544 render_view_.get(), frame, true); 1547 render_view_.get(), frame, browser_plugin_delegate);
1545 } 1548 }
1546 1549
1547 1550
1548 WebPluginParams params_to_use = params; 1551 WebPluginParams params_to_use = params;
1549 params_to_use.mimeType = WebString::fromUTF8(mime_type); 1552 params_to_use.mimeType = WebString::fromUTF8(mime_type);
1550 return CreatePlugin(frame, info, params_to_use); 1553 return CreatePlugin(frame, info, params_to_use);
1551 #else 1554 #else
1552 return NULL; 1555 return NULL;
1553 #endif // defined(ENABLE_PLUGINS) 1556 #endif // defined(ENABLE_PLUGINS)
1554 } 1557 }
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after
3849 3852
3850 #if defined(ENABLE_BROWSER_CDMS) 3853 #if defined(ENABLE_BROWSER_CDMS)
3851 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 3854 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
3852 if (!cdm_manager_) 3855 if (!cdm_manager_)
3853 cdm_manager_ = new RendererCdmManager(this); 3856 cdm_manager_ = new RendererCdmManager(this);
3854 return cdm_manager_; 3857 return cdm_manager_;
3855 } 3858 }
3856 #endif // defined(ENABLE_BROWSER_CDMS) 3859 #endif // defined(ENABLE_BROWSER_CDMS)
3857 3860
3858 } // namespace content 3861 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698