summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 10:49:25 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 10:49:25 +0000
commita0f34ab707d4d68c0e29c231cbc012e2df2c025f (patch)
tree4ee9fde9c0f5030ec83f76dd4ac7635ddf5b46bd /content/shell
parentf1124b74439cbd91b11f5add0a018984818ab154 (diff)
downloadchromium_src-a0f34ab707d4d68c0e29c231cbc012e2df2c025f.zip
chromium_src-a0f34ab707d4d68c0e29c231cbc012e2df2c025f.tar.gz
chromium_src-a0f34ab707d4d68c0e29c231cbc012e2df2c025f.tar.bz2
[content shell] don't show the context menu when running layout tests
BUG=111316 R=marja@chromium.org Review URL: https://codereview.chromium.org/11316015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/shell_web_contents_view_delegate_gtk.cc5
-rw-r--r--content/shell/shell_web_contents_view_delegate_mac.mm5
-rw-r--r--content/shell/shell_web_contents_view_delegate_win.cc5
3 files changed, 15 insertions, 0 deletions
diff --git a/content/shell/shell_web_contents_view_delegate_gtk.cc b/content/shell/shell_web_contents_view_delegate_gtk.cc
index 3bafa1a..dd617f9 100644
--- a/content/shell/shell_web_contents_view_delegate_gtk.cc
+++ b/content/shell/shell_web_contents_view_delegate_gtk.cc
@@ -4,6 +4,7 @@
#include "content/shell/shell_web_contents_view_delegate.h"
+#include "base/command_line.h"
#include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
@@ -16,6 +17,7 @@
#include "content/shell/shell_browser_main_parts.h"
#include "content/shell/shell_content_browser_client.h"
#include "content/shell/shell_devtools_delegate.h"
+#include "content/shell/shell_switches.h"
#include "content/shell/shell_web_contents_view_delegate_creator.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
#include "ui/base/gtk/focus_store_gtk.h"
@@ -43,6 +45,9 @@ ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() {
void ShellWebContentsViewDelegate::ShowContextMenu(
const ContextMenuParams& params,
ContextMenuSourceType type) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ return;
+
GtkWidget* menu = gtk_menu_new();
params_ = params;
diff --git a/content/shell/shell_web_contents_view_delegate_mac.mm b/content/shell/shell_web_contents_view_delegate_mac.mm
index a06139b..05b1e50 100644
--- a/content/shell/shell_web_contents_view_delegate_mac.mm
+++ b/content/shell/shell_web_contents_view_delegate_mac.mm
@@ -6,6 +6,7 @@
#import <Cocoa/Cocoa.h>
+#include "base/command_line.h"
#include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
@@ -18,6 +19,7 @@
#include "content/shell/shell_browser_main_parts.h"
#include "content/shell/shell_content_browser_client.h"
#include "content/shell/shell_devtools_delegate.h"
+#include "content/shell/shell_switches.h"
#include "content/shell/shell_web_contents_view_delegate_creator.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
@@ -94,6 +96,9 @@ ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() {
void ShellWebContentsViewDelegate::ShowContextMenu(
const ContextMenuParams& params,
ContextMenuSourceType type) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ return;
+
params_ = params;
bool has_link = !params_.unfiltered_link_url.is_empty();
bool has_selection = ! params_.selection_text.empty();
diff --git a/content/shell/shell_web_contents_view_delegate_win.cc b/content/shell/shell_web_contents_view_delegate_win.cc
index 8a3dcfb..af173d2 100644
--- a/content/shell/shell_web_contents_view_delegate_win.cc
+++ b/content/shell/shell_web_contents_view_delegate_win.cc
@@ -4,6 +4,7 @@
#include "content/shell/shell_web_contents_view_delegate.h"
+#include "base/command_line.h"
#include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
@@ -16,6 +17,7 @@
#include "content/shell/shell_browser_main_parts.h"
#include "content/shell/shell_content_browser_client.h"
#include "content/shell/shell_devtools_delegate.h"
+#include "content/shell/shell_switches.h"
#include "content/shell/shell_web_contents_view_delegate_creator.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
@@ -71,6 +73,9 @@ ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() {
void ShellWebContentsViewDelegate::ShowContextMenu(
const ContextMenuParams& params,
ContextMenuSourceType type) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ return;
+
params_ = params;
bool has_link = !params_.unfiltered_link_url.is_empty();
bool has_selection = !params_.selection_text.empty();