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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 837 |
838 return browser; | 838 return browser; |
839 } | 839 } |
840 | 840 |
841 void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( | 841 void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( |
842 Browser* browser, | 842 Browser* browser, |
843 chrome::startup::IsProcessStartup is_process_startup) { | 843 chrome::startup::IsProcessStartup is_process_startup) { |
844 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) | 844 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) |
845 return; | 845 return; |
846 | 846 |
847 if (HasPendingUncleanExit(browser->profile())) { | 847 if (HasPendingUncleanExit(browser->profile()) && |
848 if (!command_line_.HasSwitch(switches::kEnableSessionCrashedBubble) || | 848 !ShowSessionCrashedBubble(browser, command_line_)) |
849 !ShowSessionCrashedBubble(browser)) | |
850 SessionCrashedInfoBarDelegate::Create(browser); | 849 SessionCrashedInfoBarDelegate::Create(browser); |
851 } | |
852 | 850 |
853 // The below info bars are only added to the first profile which is launched. | 851 // The below info bars are only added to the first profile which is launched. |
854 // Other profiles might be restoring the browsing sessions asynchronously, | 852 // Other profiles might be restoring the browsing sessions asynchronously, |
855 // so we cannot add the info bars to the focused tabs here. | 853 // so we cannot add the info bars to the focused tabs here. |
856 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && | 854 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && |
857 !command_line_.HasSwitch(switches::kTestType)) { | 855 !command_line_.HasSwitch(switches::kTestType)) { |
858 chrome::ShowBadFlagsPrompt(browser); | 856 chrome::ShowBadFlagsPrompt(browser); |
859 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( | 857 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( |
860 browser->tab_strip_model()->GetActiveWebContents())); | 858 browser->tab_strip_model()->GetActiveWebContents())); |
861 ObsoleteSystemInfoBarDelegate::Create(InfoBarService::FromWebContents( | 859 ObsoleteSystemInfoBarDelegate::Create(InfoBarService::FromWebContents( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 // If the first URL is the NTP, replace it with the sync promo. This | 931 // If the first URL is the NTP, replace it with the sync promo. This |
934 // behavior is desired because completing or skipping the sync promo | 932 // behavior is desired because completing or skipping the sync promo |
935 // causes a redirect to the NTP. | 933 // causes a redirect to the NTP. |
936 if (!startup_urls->empty() && IsNewTabURL(profile_, startup_urls->at(0))) | 934 if (!startup_urls->empty() && IsNewTabURL(profile_, startup_urls->at(0))) |
937 startup_urls->at(0) = sync_promo_url; | 935 startup_urls->at(0) = sync_promo_url; |
938 else | 936 else |
939 startup_urls->insert(startup_urls->begin(), sync_promo_url); | 937 startup_urls->insert(startup_urls->begin(), sync_promo_url); |
940 } | 938 } |
941 } | 939 } |
942 } | 940 } |
OLD | NEW |