| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 void RenderViewImpl::UnregisterPluginDelegate( | 1129 void RenderViewImpl::UnregisterPluginDelegate( |
| 1130 WebPluginDelegateProxy* delegate) { | 1130 WebPluginDelegateProxy* delegate) { |
| 1131 plugin_delegates_.erase(delegate); | 1131 plugin_delegates_.erase(delegate); |
| 1132 } | 1132 } |
| 1133 | 1133 |
| 1134 bool RenderViewImpl::GetPluginInfo(const GURL& url, | 1134 bool RenderViewImpl::GetPluginInfo(const GURL& url, |
| 1135 const GURL& page_url, | 1135 const GURL& page_url, |
| 1136 const std::string& mime_type, | 1136 const std::string& mime_type, |
| 1137 webkit::WebPluginInfo* plugin_info, | 1137 WebPluginInfo* plugin_info, |
| 1138 std::string* actual_mime_type) { | 1138 std::string* actual_mime_type) { |
| 1139 bool found = false; | 1139 bool found = false; |
| 1140 Send(new ViewHostMsg_GetPluginInfo( | 1140 Send(new ViewHostMsg_GetPluginInfo( |
| 1141 routing_id_, url, page_url, mime_type, &found, plugin_info, | 1141 routing_id_, url, page_url, mime_type, &found, plugin_info, |
| 1142 actual_mime_type)); | 1142 actual_mime_type)); |
| 1143 return found; | 1143 return found; |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 void RenderViewImpl::TransferActiveWheelFlingAnimation( | 1146 void RenderViewImpl::TransferActiveWheelFlingAnimation( |
| 1147 const WebKit::WebActiveWheelFlingParameters& params) { | 1147 const WebKit::WebActiveWheelFlingParameters& params) { |
| (...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2823 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 2823 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
| 2824 this, frame, params, &plugin)) { | 2824 this, frame, params, &plugin)) { |
| 2825 return plugin; | 2825 return plugin; |
| 2826 } | 2826 } |
| 2827 | 2827 |
| 2828 #if defined(ENABLE_PLUGINS) | 2828 #if defined(ENABLE_PLUGINS) |
| 2829 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { | 2829 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { |
| 2830 return GetBrowserPluginManager()->CreateBrowserPlugin(this, frame, params); | 2830 return GetBrowserPluginManager()->CreateBrowserPlugin(this, frame, params); |
| 2831 } | 2831 } |
| 2832 | 2832 |
| 2833 webkit::WebPluginInfo info; | 2833 WebPluginInfo info; |
| 2834 std::string mime_type; | 2834 std::string mime_type; |
| 2835 bool found = GetPluginInfo(params.url, frame->top()->document().url(), | 2835 bool found = GetPluginInfo(params.url, frame->top()->document().url(), |
| 2836 params.mimeType.utf8(), &info, &mime_type); | 2836 params.mimeType.utf8(), &info, &mime_type); |
| 2837 if (!found) | 2837 if (!found) |
| 2838 return NULL; | 2838 return NULL; |
| 2839 | 2839 |
| 2840 WebPluginParams params_to_use = params; | 2840 WebPluginParams params_to_use = params; |
| 2841 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 2841 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
| 2842 return CreatePlugin(frame, info, params_to_use); | 2842 return CreatePlugin(frame, info, params_to_use); |
| 2843 #else | 2843 #else |
| (...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4674 break; | 4674 break; |
| 4675 } | 4675 } |
| 4676 } | 4676 } |
| 4677 } | 4677 } |
| 4678 | 4678 |
| 4679 return false; | 4679 return false; |
| 4680 } | 4680 } |
| 4681 | 4681 |
| 4682 WebKit::WebPlugin* RenderViewImpl::CreatePlugin( | 4682 WebKit::WebPlugin* RenderViewImpl::CreatePlugin( |
| 4683 WebKit::WebFrame* frame, | 4683 WebKit::WebFrame* frame, |
| 4684 const webkit::WebPluginInfo& info, | 4684 const WebPluginInfo& info, |
| 4685 const WebKit::WebPluginParams& params) { | 4685 const WebKit::WebPluginParams& params) { |
| 4686 WebKit::WebPlugin* pepper_webplugin = | 4686 WebKit::WebPlugin* pepper_webplugin = |
| 4687 pepper_helper_->CreatePepperWebPlugin(info, params); | 4687 pepper_helper_->CreatePepperWebPlugin(info, params); |
| 4688 | 4688 |
| 4689 if (pepper_webplugin) | 4689 if (pepper_webplugin) |
| 4690 return pepper_webplugin; | 4690 return pepper_webplugin; |
| 4691 | 4691 |
| 4692 return new WebPluginImpl(frame, params, info.path, AsWeakPtr()); | 4692 return new WebPluginImpl(frame, params, info.path, AsWeakPtr()); |
| 4693 } | 4693 } |
| 4694 | 4694 |
| (...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6739 WebURL url = icon_urls[i].iconURL(); | 6739 WebURL url = icon_urls[i].iconURL(); |
| 6740 if (!url.isEmpty()) | 6740 if (!url.isEmpty()) |
| 6741 urls.push_back(FaviconURL(url, | 6741 urls.push_back(FaviconURL(url, |
| 6742 ToFaviconType(icon_urls[i].iconType()))); | 6742 ToFaviconType(icon_urls[i].iconType()))); |
| 6743 } | 6743 } |
| 6744 SendUpdateFaviconURL(urls); | 6744 SendUpdateFaviconURL(urls); |
| 6745 } | 6745 } |
| 6746 | 6746 |
| 6747 | 6747 |
| 6748 } // namespace content | 6748 } // namespace content |
| OLD | NEW |