| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 3164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3175 RenderFrameDeleted(render_frame_host)); | 3175 RenderFrameDeleted(render_frame_host)); |
| 3176 } | 3176 } |
| 3177 | 3177 |
| 3178 void WebContentsImpl::WorkerCrashed(RenderFrameHost* render_frame_host) { | 3178 void WebContentsImpl::WorkerCrashed(RenderFrameHost* render_frame_host) { |
| 3179 if (delegate_) | 3179 if (delegate_) |
| 3180 delegate_->WorkerCrashed(this); | 3180 delegate_->WorkerCrashed(this); |
| 3181 } | 3181 } |
| 3182 | 3182 |
| 3183 void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host, | 3183 void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host, |
| 3184 const ContextMenuParams& params) { | 3184 const ContextMenuParams& params) { |
| 3185 ContextMenuParams context_menu_params(params); |
| 3185 // Allow WebContentsDelegates to handle the context menu operation first. | 3186 // Allow WebContentsDelegates to handle the context menu operation first. |
| 3186 if (delegate_ && delegate_->HandleContextMenu(params)) | 3187 if (GetBrowserPluginGuest()) { |
| 3188 WebContentsViewGuest* view_guest = |
| 3189 static_cast<WebContentsViewGuest*>(GetView()); |
| 3190 context_menu_params = view_guest->ConvertContextMenuParams(params); |
| 3191 } |
| 3192 if (delegate_ && delegate_->HandleContextMenu(context_menu_params)) |
| 3187 return; | 3193 return; |
| 3188 | 3194 |
| 3189 render_view_host_delegate_view_->ShowContextMenu(render_frame_host, params); | 3195 render_view_host_delegate_view_->ShowContextMenu(render_frame_host, |
| 3196 context_menu_params); |
| 3190 } | 3197 } |
| 3191 | 3198 |
| 3192 void WebContentsImpl::RunJavaScriptMessage( | 3199 void WebContentsImpl::RunJavaScriptMessage( |
| 3193 RenderFrameHost* render_frame_host, | 3200 RenderFrameHost* render_frame_host, |
| 3194 const base::string16& message, | 3201 const base::string16& message, |
| 3195 const base::string16& default_prompt, | 3202 const base::string16& default_prompt, |
| 3196 const GURL& frame_url, | 3203 const GURL& frame_url, |
| 3197 JavaScriptMessageType javascript_message_type, | 3204 JavaScriptMessageType javascript_message_type, |
| 3198 IPC::Message* reply_msg) { | 3205 IPC::Message* reply_msg) { |
| 3199 // Suppress JavaScript dialogs when requested. Also suppress messages when | 3206 // Suppress JavaScript dialogs when requested. Also suppress messages when |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4070 | 4077 |
| 4071 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4078 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
| 4072 if (!delegate_) | 4079 if (!delegate_) |
| 4073 return; | 4080 return; |
| 4074 const gfx::Size new_size = GetPreferredSize(); | 4081 const gfx::Size new_size = GetPreferredSize(); |
| 4075 if (new_size != old_size) | 4082 if (new_size != old_size) |
| 4076 delegate_->UpdatePreferredSize(this, new_size); | 4083 delegate_->UpdatePreferredSize(this, new_size); |
| 4077 } | 4084 } |
| 4078 | 4085 |
| 4079 } // namespace content | 4086 } // namespace content |
| OLD | NEW |