OLD | NEW |
---|---|
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 "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 #include "chrome/browser/ui/browser_list.h" | 60 #include "chrome/browser/ui/browser_list.h" |
61 #include "chrome/browser/ui/browser_navigator.h" | 61 #include "chrome/browser/ui/browser_navigator.h" |
62 #include "chrome/browser/ui/browser_navigator_params.h" | 62 #include "chrome/browser/ui/browser_navigator_params.h" |
63 #include "chrome/browser/ui/browser_tabrestore.h" | 63 #include "chrome/browser/ui/browser_tabrestore.h" |
64 #include "chrome/browser/ui/browser_tabstrip.h" | 64 #include "chrome/browser/ui/browser_tabstrip.h" |
65 #include "chrome/browser/ui/browser_window.h" | 65 #include "chrome/browser/ui/browser_window.h" |
66 #include "chrome/browser/ui/chrome_pages.h" | 66 #include "chrome/browser/ui/chrome_pages.h" |
67 #include "chrome/browser/ui/extensions/app_launch_params.h" | 67 #include "chrome/browser/ui/extensions/app_launch_params.h" |
68 #include "chrome/browser/ui/extensions/application_launch.h" | 68 #include "chrome/browser/ui/extensions/application_launch.h" |
69 #include "chrome/browser/ui/session_crashed_bubble.h" | 69 #include "chrome/browser/ui/session_crashed_bubble.h" |
70 #include "chrome/browser/ui/startup/automation_infobar_delegate.h" | |
70 #include "chrome/browser/ui/startup/bad_flags_prompt.h" | 71 #include "chrome/browser/ui/startup/bad_flags_prompt.h" |
71 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 72 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
72 #include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h" | 73 #include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h" |
73 #include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h" | 74 #include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h" |
74 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 75 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
75 #include "chrome/browser/ui/startup/startup_features.h" | 76 #include "chrome/browser/ui/startup/startup_features.h" |
76 #include "chrome/browser/ui/tabs/pinned_tab_codec.h" | 77 #include "chrome/browser/ui/tabs/pinned_tab_codec.h" |
77 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 78 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
78 #include "chrome/common/chrome_constants.h" | 79 #include "chrome/common/chrome_constants.h" |
79 #include "chrome/common/chrome_paths.h" | 80 #include "chrome/common/chrome_paths.h" |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
800 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) | 801 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) |
801 return; | 802 return; |
802 | 803 |
803 if (HasPendingUncleanExit(browser->profile()) && | 804 if (HasPendingUncleanExit(browser->profile()) && |
804 !SessionCrashedBubble::Show(browser)) { | 805 !SessionCrashedBubble::Show(browser)) { |
805 #if defined(OS_MACOSX) && !BUILDFLAG(MAC_VIEWS_BROWSER) | 806 #if defined(OS_MACOSX) && !BUILDFLAG(MAC_VIEWS_BROWSER) |
806 SessionCrashedInfoBarDelegate::Create(browser); | 807 SessionCrashedInfoBarDelegate::Create(browser); |
807 #endif | 808 #endif |
808 } | 809 } |
809 | 810 |
811 if (command_line_.HasSwitch(switches::kEnableAutomation)) | |
812 AutomationInfoBarDelegate::Create(); | |
813 | |
810 // The below info bars are only added to the first profile which is launched. | 814 // The below info bars are only added to the first profile which is launched. |
811 // Other profiles might be restoring the browsing sessions asynchronously, | 815 // Other profiles might be restoring the browsing sessions asynchronously, |
812 // so we cannot add the info bars to the focused tabs here. | 816 // so we cannot add the info bars to the focused tabs here. |
817 // | |
818 // These info bars are not shown when the browser is being controlled by an | |
Peter Kasting
2017/02/14 00:34:27
Nit: Remove "an"
samuong
2017/02/14 00:43:11
Done.
| |
819 // automated tests, so that they don't interfere with tests that assume no | |
820 // info bars. | |
813 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && | 821 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && |
814 !command_line_.HasSwitch(switches::kTestType)) { | 822 !command_line_.HasSwitch(switches::kTestType) && |
823 !command_line_.HasSwitch(switches::kEnableAutomation)) { | |
815 chrome::ShowBadFlagsPrompt(browser); | 824 chrome::ShowBadFlagsPrompt(browser); |
816 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( | 825 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( |
817 browser->tab_strip_model()->GetActiveWebContents())); | 826 browser->tab_strip_model()->GetActiveWebContents())); |
818 ObsoleteSystemInfoBarDelegate::Create(InfoBarService::FromWebContents( | 827 ObsoleteSystemInfoBarDelegate::Create(InfoBarService::FromWebContents( |
819 browser->tab_strip_model()->GetActiveWebContents())); | 828 browser->tab_strip_model()->GetActiveWebContents())); |
820 | 829 |
821 #if !defined(OS_CHROMEOS) | 830 #if !defined(OS_CHROMEOS) |
822 if (!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { | 831 if (!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { |
823 // Generally, the default browser prompt should not be shown on first | 832 // Generally, the default browser prompt should not be shown on first |
824 // run. However, when the set-as-default dialog has been suppressed, we | 833 // run. However, when the set-as-default dialog has been suppressed, we |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1229 #if defined(OS_WIN) | 1238 #if defined(OS_WIN) |
1230 TriggeredProfileResetter* triggered_profile_resetter = | 1239 TriggeredProfileResetter* triggered_profile_resetter = |
1231 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 1240 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
1232 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 1241 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
1233 if (triggered_profile_resetter) { | 1242 if (triggered_profile_resetter) { |
1234 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 1243 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
1235 } | 1244 } |
1236 #endif // defined(OS_WIN) | 1245 #endif // defined(OS_WIN) |
1237 return has_reset_trigger; | 1246 return has_reset_trigger; |
1238 } | 1247 } |
OLD | NEW |