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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.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/startup/automation_infobar_delegate.cc ('k') | 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/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 237ccc7800a9a39c18aa603224b7e497556aa7d9..bd234d54a9d50feec4ea8311f4ed1537856656c8 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -66,6 +66,7 @@
#include "chrome/browser/ui/extensions/app_launch_params.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/session_crashed_bubble.h"
+#include "chrome/browser/ui/startup/automation_infobar_delegate.h"
#include "chrome/browser/ui/startup/bad_flags_prompt.h"
#include "chrome/browser/ui/startup/default_browser_prompt.h"
#include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h"
@@ -816,11 +817,19 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary(
#endif
}
+ if (command_line_.HasSwitch(switches::kEnableAutomation))
+ AutomationInfoBarDelegate::Create();
+
// The below info bars are only added to the first profile which is launched.
// Other profiles might be restoring the browsing sessions asynchronously,
// so we cannot add the info bars to the focused tabs here.
+ //
+ // These info bars are not shown when the browser is being controlled by
+ // automated tests, so that they don't interfere with tests that assume no
+ // info bars.
if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP &&
- !command_line_.HasSwitch(switches::kTestType)) {
+ !command_line_.HasSwitch(switches::kTestType) &&
+ !command_line_.HasSwitch(switches::kEnableAutomation)) {
chrome::ShowBadFlagsPrompt(browser);
GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents(
browser->tab_strip_model()->GetActiveWebContents()));
« no previous file with comments | « chrome/browser/ui/startup/automation_infobar_delegate.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698