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

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 comment from kenrb@ 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 25 matching lines...) Expand all
36 #include "content/common/service_worker/service_worker_types.h" 36 #include "content/common/service_worker/service_worker_types.h"
37 #include "content/common/socket_stream_handle_data.h" 37 #include "content/common/socket_stream_handle_data.h"
38 #include "content/common/swapped_out_messages.h" 38 #include "content/common/swapped_out_messages.h"
39 #include "content/common/view_messages.h" 39 #include "content/common/view_messages.h"
40 #include "content/public/common/bindings_policy.h" 40 #include "content/public/common/bindings_policy.h"
41 #include "content/public/common/content_constants.h" 41 #include "content/public/common/content_constants.h"
42 #include "content/public/common/content_switches.h" 42 #include "content/public/common/content_switches.h"
43 #include "content/public/common/context_menu_params.h" 43 #include "content/public/common/context_menu_params.h"
44 #include "content/public/common/url_constants.h" 44 #include "content/public/common/url_constants.h"
45 #include "content/public/common/url_utils.h" 45 #include "content/public/common/url_utils.h"
46 #include "content/public/renderer/browser_plugin_delegate.h"
46 #include "content/public/renderer/content_renderer_client.h" 47 #include "content/public/renderer/content_renderer_client.h"
47 #include "content/public/renderer/context_menu_client.h" 48 #include "content/public/renderer/context_menu_client.h"
48 #include "content/public/renderer/document_state.h" 49 #include "content/public/renderer/document_state.h"
49 #include "content/public/renderer/navigation_state.h" 50 #include "content/public/renderer/navigation_state.h"
50 #include "content/public/renderer/render_frame_observer.h" 51 #include "content/public/renderer/render_frame_observer.h"
51 #include "content/renderer/accessibility/renderer_accessibility.h" 52 #include "content/renderer/accessibility/renderer_accessibility.h"
52 #include "content/renderer/accessibility/renderer_accessibility_complete.h" 53 #include "content/renderer/accessibility/renderer_accessibility_complete.h"
53 #include "content/renderer/accessibility/renderer_accessibility_focus_only.h" 54 #include "content/renderer/accessibility/renderer_accessibility_focus_only.h"
54 #include "content/renderer/browser_plugin/browser_plugin.h" 55 #include "content/renderer/browser_plugin/browser_plugin.h"
55 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 56 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 const blink::WebPluginParams& params) { 1545 const blink::WebPluginParams& params) {
1545 DCHECK_EQ(frame_, frame); 1546 DCHECK_EQ(frame_, frame);
1546 blink::WebPlugin* plugin = NULL; 1547 blink::WebPlugin* plugin = NULL;
1547 if (GetContentClient()->renderer()->OverrideCreatePlugin( 1548 if (GetContentClient()->renderer()->OverrideCreatePlugin(
1548 this, frame, params, &plugin)) { 1549 this, frame, params, &plugin)) {
1549 return plugin; 1550 return plugin;
1550 } 1551 }
1551 1552
1552 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { 1553 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) {
1553 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( 1554 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin(
1554 render_view_.get(), frame, false); 1555 render_view_.get(), frame, scoped_ptr<BrowserPluginDelegate>());
1555 } 1556 }
1556 1557
1557 #if defined(ENABLE_PLUGINS) 1558 #if defined(ENABLE_PLUGINS)
1558 WebPluginInfo info; 1559 WebPluginInfo info;
1559 std::string mime_type; 1560 std::string mime_type;
1560 bool found = false; 1561 bool found = false;
1561 Send(new FrameHostMsg_GetPluginInfo( 1562 Send(new FrameHostMsg_GetPluginInfo(
1562 routing_id_, params.url, frame->top()->document().url(), 1563 routing_id_, params.url, frame->top()->document().url(),
1563 params.mimeType.utf8(), &found, &info, &mime_type)); 1564 params.mimeType.utf8(), &found, &info, &mime_type));
1564 if (!found) 1565 if (!found)
1565 return NULL; 1566 return NULL;
1566 1567
1567 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { 1568 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) {
1569 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate(
1570 GetContentClient()->renderer()->CreateBrowserPluginDelegate(
1571 this, base::UTF16ToUTF8(params.mimeType)));
1568 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( 1572 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin(
1569 render_view_.get(), frame, true); 1573 render_view_.get(), frame, browser_plugin_delegate.Pass());
1570 } 1574 }
1571 1575
1572 1576
1573 WebPluginParams params_to_use = params; 1577 WebPluginParams params_to_use = params;
1574 params_to_use.mimeType = WebString::fromUTF8(mime_type); 1578 params_to_use.mimeType = WebString::fromUTF8(mime_type);
1575 return CreatePlugin(frame, info, params_to_use); 1579 return CreatePlugin(frame, info, params_to_use);
1576 #else 1580 #else
1577 return NULL; 1581 return NULL;
1578 #endif // defined(ENABLE_PLUGINS) 1582 #endif // defined(ENABLE_PLUGINS)
1579 } 1583 }
(...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after
3875 3879
3876 #if defined(ENABLE_BROWSER_CDMS) 3880 #if defined(ENABLE_BROWSER_CDMS)
3877 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 3881 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
3878 if (!cdm_manager_) 3882 if (!cdm_manager_)
3879 cdm_manager_ = new RendererCdmManager(this); 3883 cdm_manager_ = new RendererCdmManager(this);
3880 return cdm_manager_; 3884 return cdm_manager_;
3881 } 3885 }
3882 #endif // defined(ENABLE_BROWSER_CDMS) 3886 #endif // defined(ENABLE_BROWSER_CDMS)
3883 3887
3884 } // namespace content 3888 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/mock_browser_plugin_manager.cc ('k') | extensions/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698