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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 OnRegisterProtocolHandler) | 683 OnRegisterProtocolHandler) |
684 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 684 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
685 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) | 685 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) |
686 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 686 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
687 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser) | 687 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser) |
688 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser) | 688 IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser) |
689 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser, | 689 IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser, |
690 OnSetSelectedColorInColorChooser) | 690 OnSetSelectedColorInColorChooser) |
691 IPC_MESSAGE_HANDLER(ViewHostMsg_PepperPluginHung, OnPepperPluginHung) | 691 IPC_MESSAGE_HANDLER(ViewHostMsg_PepperPluginHung, OnPepperPluginHung) |
692 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) | 692 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
| 693 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission, |
| 694 OnRequestPpapiBrokerPermission) |
693 IPC_MESSAGE_UNHANDLED(handled = false) | 695 IPC_MESSAGE_UNHANDLED(handled = false) |
694 IPC_END_MESSAGE_MAP_EX() | 696 IPC_END_MESSAGE_MAP_EX() |
695 message_source_ = NULL; | 697 message_source_ = NULL; |
696 | 698 |
697 if (!message_is_ok) { | 699 if (!message_is_ok) { |
698 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); | 700 content::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); |
699 GetRenderProcessHost()->ReceivedBadMessage(); | 701 GetRenderProcessHost()->ReceivedBadMessage(); |
700 } | 702 } |
701 | 703 |
702 return handled; | 704 return handled; |
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2184 | 2186 |
2185 // This exists for render views that don't have a WebUI, but do have WebUI | 2187 // This exists for render views that don't have a WebUI, but do have WebUI |
2186 // bindings enabled. | 2188 // bindings enabled. |
2187 void WebContentsImpl::OnWebUISend(const GURL& source_url, | 2189 void WebContentsImpl::OnWebUISend(const GURL& source_url, |
2188 const std::string& name, | 2190 const std::string& name, |
2189 const base::ListValue& args) { | 2191 const base::ListValue& args) { |
2190 if (delegate_) | 2192 if (delegate_) |
2191 delegate_->WebUISend(this, source_url, name, args); | 2193 delegate_->WebUISend(this, source_url, name, args); |
2192 } | 2194 } |
2193 | 2195 |
| 2196 void WebContentsImpl::OnRequestPpapiBrokerPermission( |
| 2197 int request_id, |
| 2198 const GURL& url, |
| 2199 const FilePath& plugin_path) { |
| 2200 if (!delegate_) { |
| 2201 OnPpapiBrokerPermissionResult(request_id, false); |
| 2202 return; |
| 2203 } |
| 2204 |
| 2205 delegate_->RequestPpapiBrokerPermission( |
| 2206 this, url, plugin_path, |
| 2207 base::Bind(&WebContentsImpl::OnPpapiBrokerPermissionResult, |
| 2208 base::Unretained(this), request_id)); |
| 2209 } |
| 2210 |
| 2211 void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id, |
| 2212 bool result) { |
| 2213 RenderViewHostImpl* rvh = GetRenderViewHostImpl(); |
| 2214 rvh->Send(new ViewMsg_PpapiBrokerPermissionResult(rvh->GetRoutingID(), |
| 2215 request_id, |
| 2216 result)); |
| 2217 } |
| 2218 |
2194 // Notifies the RenderWidgetHost instance about the fact that the page is | 2219 // Notifies the RenderWidgetHost instance about the fact that the page is |
2195 // loading, or done loading and calls the base implementation. | 2220 // loading, or done loading and calls the base implementation. |
2196 void WebContentsImpl::SetIsLoading(bool is_loading, | 2221 void WebContentsImpl::SetIsLoading(bool is_loading, |
2197 LoadNotificationDetails* details) { | 2222 LoadNotificationDetails* details) { |
2198 if (is_loading == is_loading_) | 2223 if (is_loading == is_loading_) |
2199 return; | 2224 return; |
2200 | 2225 |
2201 if (!is_loading) { | 2226 if (!is_loading) { |
2202 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); | 2227 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); |
2203 load_state_host_.clear(); | 2228 load_state_host_.clear(); |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3154 old_browser_plugin_host()->embedder_render_process_host(); | 3179 old_browser_plugin_host()->embedder_render_process_host(); |
3155 *embedder_container_id = old_browser_plugin_host()->instance_id(); | 3180 *embedder_container_id = old_browser_plugin_host()->instance_id(); |
3156 int embedder_process_id = | 3181 int embedder_process_id = |
3157 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3182 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3158 if (embedder_process_id != -1) { | 3183 if (embedder_process_id != -1) { |
3159 *embedder_channel_name = | 3184 *embedder_channel_name = |
3160 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3185 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3161 embedder_process_id); | 3186 embedder_process_id); |
3162 } | 3187 } |
3163 } | 3188 } |
OLD | NEW |