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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 10917102: Context menus should appear above the touch point if invoked by long press. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 3 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 | Annotate | Revision Log
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/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "content/public/browser/native_web_keyboard_event.h" 46 #include "content/public/browser/native_web_keyboard_event.h"
47 #include "content/public/browser/notification_details.h" 47 #include "content/public/browser/notification_details.h"
48 #include "content/public/browser/notification_service.h" 48 #include "content/public/browser/notification_service.h"
49 #include "content/public/browser/notification_types.h" 49 #include "content/public/browser/notification_types.h"
50 #include "content/public/browser/render_view_host_observer.h" 50 #include "content/public/browser/render_view_host_observer.h"
51 #include "content/public/browser/user_metrics.h" 51 #include "content/public/browser/user_metrics.h"
52 #include "content/public/common/bindings_policy.h" 52 #include "content/public/common/bindings_policy.h"
53 #include "content/public/common/content_constants.h" 53 #include "content/public/common/content_constants.h"
54 #include "content/public/common/content_switches.h" 54 #include "content/public/common/content_switches.h"
55 #include "content/public/common/context_menu_params.h" 55 #include "content/public/common/context_menu_params.h"
56 #include "content/public/common/context_menu_event_type.h"
56 #include "content/public/common/result_codes.h" 57 #include "content/public/common/result_codes.h"
57 #include "content/public/common/url_constants.h" 58 #include "content/public/common/url_constants.h"
58 #include "net/base/net_util.h" 59 #include "net/base/net_util.h"
59 #include "net/url_request/url_request_context_getter.h" 60 #include "net/url_request/url_request_context_getter.h"
60 #include "third_party/skia/include/core/SkBitmap.h" 61 #include "third_party/skia/include/core/SkBitmap.h"
61 #include "ui/base/dialogs/selected_file_info.h" 62 #include "ui/base/dialogs/selected_file_info.h"
62 #include "ui/gfx/image/image_skia.h" 63 #include "ui/gfx/image/image_skia.h"
63 #include "ui/gfx/native_widget_types.h" 64 #include "ui/gfx/native_widget_types.h"
64 #include "webkit/fileapi/isolated_context.h" 65 #include "webkit/fileapi/isolated_context.h"
65 #include "webkit/glue/webdropdata.h" 66 #include "webkit/glue/webdropdata.h"
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 ChildProcessSecurityPolicyImpl* policy = 1235 ChildProcessSecurityPolicyImpl* policy =
1235 ChildProcessSecurityPolicyImpl::GetInstance(); 1236 ChildProcessSecurityPolicyImpl::GetInstance();
1236 1237
1237 // We don't validate |unfiltered_link_url| so that this field can be used 1238 // We don't validate |unfiltered_link_url| so that this field can be used
1238 // when users want to copy the original link URL. 1239 // when users want to copy the original link URL.
1239 FilterURL(policy, renderer_id, true, &validated_params.link_url); 1240 FilterURL(policy, renderer_id, true, &validated_params.link_url);
1240 FilterURL(policy, renderer_id, true, &validated_params.src_url); 1241 FilterURL(policy, renderer_id, true, &validated_params.src_url);
1241 FilterURL(policy, renderer_id, false, &validated_params.page_url); 1242 FilterURL(policy, renderer_id, false, &validated_params.page_url);
1242 FilterURL(policy, renderer_id, true, &validated_params.frame_url); 1243 FilterURL(policy, renderer_id, true, &validated_params.frame_url);
1243 1244
1244 delegate_->ShowContextMenu(validated_params); 1245 content::ContextMenuEventType type = content::NO_CONTEXT_MENU;
sky 2012/09/05 23:57:00 When can we hit this?
varunjain 2012/09/06 03:49:55 I included this to represent the case where javasc
1246 DCHECK(!in_process_event_types_.empty());
1247 WebKit::WebInputEvent::Type event_type = in_process_event_types_.front();
1248 if (WebKit::WebInputEvent::isMouseEventType(event_type))
1249 type = content::MOUSE_CONTEXT_MENU;
1250 else if (WebKit::WebInputEvent::isGestureEventType(event_type))
1251 type = content::GESTURE_CONTEXT_MENU;
1252 else if (WebKit::WebInputEvent::isKeyboardEventType(event_type))
1253 type = content::KEYBOARD_CONTEXT_MENU;
1254 delegate_->ShowContextMenu(validated_params, type);
1245 } 1255 }
1246 1256
1247 void RenderViewHostImpl::OnMsgToggleFullscreen(bool enter_fullscreen) { 1257 void RenderViewHostImpl::OnMsgToggleFullscreen(bool enter_fullscreen) {
1248 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1258 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1249 delegate_->ToggleFullscreenMode(enter_fullscreen); 1259 delegate_->ToggleFullscreenMode(enter_fullscreen);
1250 WasResized(); 1260 WasResized();
1251 } 1261 }
1252 1262
1253 void RenderViewHostImpl::OnMsgOpenURL(const GURL& url, 1263 void RenderViewHostImpl::OnMsgOpenURL(const GURL& url,
1254 const content::Referrer& referrer, 1264 const content::Referrer& referrer,
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 // can cause navigations to be ignored in OnMsgNavigate. 1903 // can cause navigations to be ignored in OnMsgNavigate.
1894 is_waiting_for_beforeunload_ack_ = false; 1904 is_waiting_for_beforeunload_ack_ = false;
1895 is_waiting_for_unload_ack_ = false; 1905 is_waiting_for_unload_ack_ = false;
1896 } 1906 }
1897 1907
1898 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1908 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1899 STLDeleteValues(&power_save_blockers_); 1909 STLDeleteValues(&power_save_blockers_);
1900 } 1910 }
1901 1911
1902 } // namespace content 1912 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698