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

Unified Diff: chrome/browser/translate/translate_manager.cc

Issue 3117044: Add --disable-translate to help Selenium/WebDriver dudes make Chrome... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_manager.cc
===================================================================
--- chrome/browser/translate/translate_manager.cc (revision 57378)
+++ chrome/browser/translate/translate_manager.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/translate/translate_manager.h"
#include "app/resource_bundle.h"
+#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/histogram.h"
#include "base/string_util.h"
@@ -23,6 +24,7 @@
#include "chrome/browser/translate/page_translated_details.h"
#include "chrome/browser/translate/translate_infobar_delegate.h"
#include "chrome/browser/translate/translate_prefs.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_details.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_source.h"
@@ -338,6 +340,11 @@
if (!prefs->GetBoolean(prefs::kEnableTranslate))
return;
+ // Allow disabling of translate from the command line to assist with
+ // automated browser testing.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableTranslate))
+ return;
+
NavigationEntry* entry = tab->controller().GetActiveEntry();
if (!entry) {
// This can happen for popups created with window.open("").
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698