| 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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 | 831 |
| 832 return browser; | 832 return browser; |
| 833 } | 833 } |
| 834 | 834 |
| 835 void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( | 835 void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( |
| 836 Browser* browser, | 836 Browser* browser, |
| 837 chrome::startup::IsProcessStartup is_process_startup) { | 837 chrome::startup::IsProcessStartup is_process_startup) { |
| 838 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) | 838 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) |
| 839 return; | 839 return; |
| 840 | 840 |
| 841 if (HasPendingUncleanExit(browser->profile())) { | 841 if (HasPendingUncleanExit(browser->profile()) && |
| 842 // Can't use command_line_ here because command_line_ isn't set to have | 842 !ShowSessionCrashedBubble(browser)) |
| 843 // correct values when a profile window is opened after the browser starts | 843 SessionCrashedInfoBarDelegate::Create(browser); |
| 844 // up (via profile switcher). See function FindOrCreateNewWindowForProfile. | |
| 845 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
| 846 switches::kEnableSessionCrashedBubble) || | |
| 847 !ShowSessionCrashedBubble(browser)) | |
| 848 SessionCrashedInfoBarDelegate::Create(browser); | |
| 849 } | |
| 850 | 844 |
| 851 // The below info bars are only added to the first profile which is launched. | 845 // The below info bars are only added to the first profile which is launched. |
| 852 // Other profiles might be restoring the browsing sessions asynchronously, | 846 // Other profiles might be restoring the browsing sessions asynchronously, |
| 853 // so we cannot add the info bars to the focused tabs here. | 847 // so we cannot add the info bars to the focused tabs here. |
| 854 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && | 848 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && |
| 855 !command_line_.HasSwitch(switches::kTestType)) { | 849 !command_line_.HasSwitch(switches::kTestType)) { |
| 856 chrome::ShowBadFlagsPrompt(browser); | 850 chrome::ShowBadFlagsPrompt(browser); |
| 857 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( | 851 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( |
| 858 browser->tab_strip_model()->GetActiveWebContents())); | 852 browser->tab_strip_model()->GetActiveWebContents())); |
| 859 ObsoleteSystemInfoBarDelegate::Create(InfoBarService::FromWebContents( | 853 ObsoleteSystemInfoBarDelegate::Create(InfoBarService::FromWebContents( |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 // behavior is desired because completing or skipping the sync promo | 926 // behavior is desired because completing or skipping the sync promo |
| 933 // causes a redirect to the NTP. | 927 // causes a redirect to the NTP. |
| 934 if (!startup_urls->empty() && | 928 if (!startup_urls->empty() && |
| 935 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) | 929 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) |
| 936 startup_urls->at(0) = sync_promo_url; | 930 startup_urls->at(0) = sync_promo_url; |
| 937 else | 931 else |
| 938 startup_urls->insert(startup_urls->begin(), sync_promo_url); | 932 startup_urls->insert(startup_urls->begin(), sync_promo_url); |
| 939 } | 933 } |
| 940 } | 934 } |
| 941 } | 935 } |
| OLD | NEW |