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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 296703005: <webview>: Make HandleContextMenu easier to refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prehandle_gesture_event
Patch Set: Created 6 years, 7 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
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698