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

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_source_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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 ChildProcessSecurityPolicyImpl* policy = 1247 ChildProcessSecurityPolicyImpl* policy =
1247 ChildProcessSecurityPolicyImpl::GetInstance(); 1248 ChildProcessSecurityPolicyImpl::GetInstance();
1248 1249
1249 // We don't validate |unfiltered_link_url| so that this field can be used 1250 // We don't validate |unfiltered_link_url| so that this field can be used
1250 // when users want to copy the original link URL. 1251 // when users want to copy the original link URL.
1251 FilterURL(policy, renderer_id, true, &validated_params.link_url); 1252 FilterURL(policy, renderer_id, true, &validated_params.link_url);
1252 FilterURL(policy, renderer_id, true, &validated_params.src_url); 1253 FilterURL(policy, renderer_id, true, &validated_params.src_url);
1253 FilterURL(policy, renderer_id, false, &validated_params.page_url); 1254 FilterURL(policy, renderer_id, false, &validated_params.page_url);
1254 FilterURL(policy, renderer_id, true, &validated_params.frame_url); 1255 FilterURL(policy, renderer_id, true, &validated_params.frame_url);
1255 1256
1256 delegate_->ShowContextMenu(validated_params); 1257 content::ContextMenuSourceType type = content::CONTEXT_MENU_SOURCE_MOUSE;
1258 if (!in_process_event_types_.empty()) {
1259 WebKit::WebInputEvent::Type event_type = in_process_event_types_.front();
1260 if (WebKit::WebInputEvent::isGestureEventType(event_type))
1261 type = content::CONTEXT_MENU_SOURCE_TOUCH;
1262 else if (WebKit::WebInputEvent::isKeyboardEventType(event_type))
1263 type = content::CONTEXT_MENU_SOURCE_KEYBOARD;
1264 }
1265 delegate_->ShowContextMenu(validated_params, type);
1257 } 1266 }
1258 1267
1259 void RenderViewHostImpl::OnMsgToggleFullscreen(bool enter_fullscreen) { 1268 void RenderViewHostImpl::OnMsgToggleFullscreen(bool enter_fullscreen) {
1260 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1269 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1261 delegate_->ToggleFullscreenMode(enter_fullscreen); 1270 delegate_->ToggleFullscreenMode(enter_fullscreen);
1262 WasResized(); 1271 WasResized();
1263 } 1272 }
1264 1273
1265 void RenderViewHostImpl::OnMsgOpenURL(const GURL& url, 1274 void RenderViewHostImpl::OnMsgOpenURL(const GURL& url,
1266 const content::Referrer& referrer, 1275 const content::Referrer& referrer,
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 // can cause navigations to be ignored in OnMsgNavigate. 1921 // can cause navigations to be ignored in OnMsgNavigate.
1913 is_waiting_for_beforeunload_ack_ = false; 1922 is_waiting_for_beforeunload_ack_ = false;
1914 is_waiting_for_unload_ack_ = false; 1923 is_waiting_for_unload_ack_ = false;
1915 } 1924 }
1916 1925
1917 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1926 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1918 STLDeleteValues(&power_save_blockers_); 1927 STLDeleteValues(&power_save_blockers_);
1919 } 1928 }
1920 1929
1921 } // namespace content 1930 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698