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

Side by Side Diff: content/shell/shell_web_contents_view_delegate_gtk.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/shell/shell_web_contents_view_delegate.h" 5 #include "content/shell/shell_web_contents_view_delegate.h"
6 6
7 #include "content/public/browser/devtools_http_handler.h" 7 #include "content/public/browser/devtools_http_handler.h"
8 #include "content/public/browser/render_process_host.h" 8 #include "content/public/browser/render_process_host.h"
9 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 10 #include "content/public/browser/render_widget_host_view.h"
(...skipping 23 matching lines...) Expand all
34 WebContents* web_contents) 34 WebContents* web_contents)
35 : web_contents_(web_contents), 35 : web_contents_(web_contents),
36 floating_(gtk_floating_container_new()) { 36 floating_(gtk_floating_container_new()) {
37 } 37 }
38 38
39 ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() { 39 ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() {
40 floating_.Destroy(); 40 floating_.Destroy();
41 } 41 }
42 42
43 void ShellWebContentsViewDelegate::ShowContextMenu( 43 void ShellWebContentsViewDelegate::ShowContextMenu(
44 const ContextMenuParams& params) { 44 const ContextMenuParams& params,
45 const ContextMenuSourceType& type) {
45 GtkWidget* menu = gtk_menu_new(); 46 GtkWidget* menu = gtk_menu_new();
46 47
47 params_ = params; 48 params_ = params;
48 bool has_link = !params_.unfiltered_link_url.is_empty(); 49 bool has_link = !params_.unfiltered_link_url.is_empty();
49 bool has_selection = !params_.selection_text.empty(); 50 bool has_selection = !params_.selection_text.empty();
50 51
51 if (params_.media_type == WebContextMenuData::MediaTypeNone && 52 if (params_.media_type == WebContextMenuData::MediaTypeNone &&
52 !has_link && 53 !has_link &&
53 !has_selection && 54 !has_selection &&
54 !params_.is_editable) { 55 !params_.is_editable) {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 GURL url = delegate->devtools_http_handler()->GetFrontendURL( 241 GURL url = delegate->devtools_http_handler()->GetFrontendURL(
241 web_contents_->GetRenderViewHost()); 242 web_contents_->GetRenderViewHost());
242 Shell::CreateNewWindow(web_contents_->GetBrowserContext(), 243 Shell::CreateNewWindow(web_contents_->GetBrowserContext(),
243 url, 244 url,
244 NULL, 245 NULL,
245 MSG_ROUTING_NONE, 246 MSG_ROUTING_NONE,
246 NULL); 247 NULL);
247 } 248 }
248 249
249 } // namespace content 250 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698