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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/app_restore_service.h" | 10 #include "apps/app_restore_service.h" |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 chrome::startup::IsProcessStartup is_process_startup) { | 890 chrome::startup::IsProcessStartup is_process_startup) { |
891 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) | 891 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) |
892 return; | 892 return; |
893 | 893 |
894 if (HasPendingUncleanExit(browser->profile())) | 894 if (HasPendingUncleanExit(browser->profile())) |
895 SessionCrashedInfoBarDelegate::Create(browser); | 895 SessionCrashedInfoBarDelegate::Create(browser); |
896 | 896 |
897 // The below info bars are only added to the first profile which is launched. | 897 // The below info bars are only added to the first profile which is launched. |
898 // Other profiles might be restoring the browsing sessions asynchronously, | 898 // Other profiles might be restoring the browsing sessions asynchronously, |
899 // so we cannot add the info bars to the focused tabs here. | 899 // so we cannot add the info bars to the focused tabs here. |
900 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP) { | 900 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && |
| 901 !command_line_.HasSwitch(switches::kTestType)) { |
901 chrome::ShowBadFlagsPrompt(browser); | 902 chrome::ShowBadFlagsPrompt(browser); |
902 if (!command_line_.HasSwitch(switches::kTestType)) { | 903 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( |
903 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( | 904 browser->tab_strip_model()->GetActiveWebContents())); |
904 browser->tab_strip_model()->GetActiveWebContents())); | |
905 } | |
906 | |
907 ObsoleteOSInfoBarDelegate::Create(InfoBarService::FromWebContents( | 905 ObsoleteOSInfoBarDelegate::Create(InfoBarService::FromWebContents( |
908 browser->tab_strip_model()->GetActiveWebContents())); | 906 browser->tab_strip_model()->GetActiveWebContents())); |
909 | 907 |
910 #if !defined(OS_CHROMEOS) | 908 #if !defined(OS_CHROMEOS) |
911 if (!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { | 909 if (!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { |
912 // Generally, the default browser prompt should not be shown on first | 910 // Generally, the default browser prompt should not be shown on first |
913 // run. However, when the set-as-default dialog has been suppressed, we | 911 // run. However, when the set-as-default dialog has been suppressed, we |
914 // need to allow it. | 912 // need to allow it. |
915 if ((!is_first_run_ || | 913 if ((!is_first_run_ || |
916 (browser_creator_ && | 914 (browser_creator_ && |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 } | 986 } |
989 | 987 |
990 #if !defined(OS_WIN) | 988 #if !defined(OS_WIN) |
991 // static | 989 // static |
992 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | 990 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
993 Profile* profile, | 991 Profile* profile, |
994 const std::vector<GURL>& startup_urls) { | 992 const std::vector<GURL>& startup_urls) { |
995 return false; | 993 return false; |
996 } | 994 } |
997 #endif | 995 #endif |
OLD | NEW |