OLD | NEW |
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 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1986 ->renderer() | 1986 ->renderer() |
1987 ->CreateBrowserPluginDelegate(this, kBrowserPluginMimeType, | 1987 ->CreateBrowserPluginDelegate(this, kBrowserPluginMimeType, |
1988 GURL(params.url)) | 1988 GURL(params.url)) |
1989 ->GetWeakPtr()); | 1989 ->GetWeakPtr()); |
1990 } | 1990 } |
1991 | 1991 |
1992 #if defined(ENABLE_PLUGINS) | 1992 #if defined(ENABLE_PLUGINS) |
1993 WebPluginInfo info; | 1993 WebPluginInfo info; |
1994 std::string mime_type; | 1994 std::string mime_type; |
1995 bool found = false; | 1995 bool found = false; |
1996 Send(new FrameHostMsg_GetPluginInfo( | 1996 WebString top_origin = frame->top()->securityOrigin().toString(); |
1997 routing_id_, params.url, frame->top()->document().url(), | 1997 Send(new FrameHostMsg_GetPluginInfo(routing_id_, params.url, GURL(top_origin), |
1998 params.mimeType.utf8(), &found, &info, &mime_type)); | 1998 params.mimeType.utf8(), &found, &info, |
| 1999 &mime_type)); |
1999 if (!found) | 2000 if (!found) |
2000 return NULL; | 2001 return NULL; |
2001 | 2002 |
2002 WebPluginParams params_to_use = params; | 2003 WebPluginParams params_to_use = params; |
2003 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 2004 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
2004 return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */); | 2005 return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */); |
2005 #else | 2006 #else |
2006 return NULL; | 2007 return NULL; |
2007 #endif // defined(ENABLE_PLUGINS) | 2008 #endif // defined(ENABLE_PLUGINS) |
2008 } | 2009 } |
(...skipping 3059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5068 void RenderFrameImpl::RegisterMojoServices() { | 5069 void RenderFrameImpl::RegisterMojoServices() { |
5069 // Only main frame have ImageDownloader service. | 5070 // Only main frame have ImageDownloader service. |
5070 if (!frame_->parent()) { | 5071 if (!frame_->parent()) { |
5071 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( | 5072 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( |
5072 base::Bind(&ImageDownloaderImpl::CreateMojoService, | 5073 base::Bind(&ImageDownloaderImpl::CreateMojoService, |
5073 base::Unretained(this))); | 5074 base::Unretained(this))); |
5074 } | 5075 } |
5075 } | 5076 } |
5076 | 5077 |
5077 } // namespace content | 5078 } // namespace content |
OLD | NEW |