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

Unified Diff: chrome/browser/ui/extensions/extension_message_bubble_factory.cc

Issue 2564973002: Add an infobar if a session is being controlled by an automated test. (Closed)
Patch Set: rebase Created 3 years, 10 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 | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/startup/automation_infobar_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/extensions/extension_message_bubble_factory.cc
diff --git a/chrome/browser/ui/extensions/extension_message_bubble_factory.cc b/chrome/browser/ui/extensions/extension_message_bubble_factory.cc
index ddbfadf60e28dcca2f43f6d58079547727e2420d..384fcae62313d7a99058fcd72a83d0b4eed27af0 100644
--- a/chrome/browser/ui/extensions/extension_message_bubble_factory.cc
+++ b/chrome/browser/ui/extensions/extension_message_bubble_factory.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/common/channel_info.h"
+#include "chrome/common/chrome_switches.h"
#include "components/version_info/version_info.h"
#include "extensions/common/feature_switch.h"
@@ -84,6 +85,14 @@ bool EnableDevModeBubble() {
if (extensions::FeatureSwitch::force_dev_mode_highlighting()->IsEnabled())
return true;
+ // If an automated test is controlling the browser, we don't show the dev mode
+ // bubble because it interferes with focus. This isn't a security concern
+ // because we'll instead show an (even scarier) infobar. See also
+ // AutomationInfoBarDelegate.
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kEnableAutomation))
+ return false;
+
#if defined(OS_WIN)
if (chrome::GetChannel() >= version_info::Channel::BETA)
return true;
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/startup/automation_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698