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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 284113006: Enable new session crashed bubble UI by Finch experiment. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/views/session_crashed_bubble_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 } 844 }
850 845
851 // The below info bars are only added to the first profile which is launched. 846 // The below info bars are only added to the first profile which is launched.
852 // Other profiles might be restoring the browsing sessions asynchronously, 847 // Other profiles might be restoring the browsing sessions asynchronously,
853 // so we cannot add the info bars to the focused tabs here. 848 // so we cannot add the info bars to the focused tabs here.
854 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP && 849 if (is_process_startup == chrome::startup::IS_PROCESS_STARTUP &&
855 !command_line_.HasSwitch(switches::kTestType)) { 850 !command_line_.HasSwitch(switches::kTestType)) {
856 chrome::ShowBadFlagsPrompt(browser); 851 chrome::ShowBadFlagsPrompt(browser);
857 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents( 852 GoogleApiKeysInfoBarDelegate::Create(InfoBarService::FromWebContents(
858 browser->tab_strip_model()->GetActiveWebContents())); 853 browser->tab_strip_model()->GetActiveWebContents()));
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 // behavior is desired because completing or skipping the sync promo 927 // behavior is desired because completing or skipping the sync promo
933 // causes a redirect to the NTP. 928 // causes a redirect to the NTP.
934 if (!startup_urls->empty() && 929 if (!startup_urls->empty() &&
935 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) 930 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL))
936 startup_urls->at(0) = sync_promo_url; 931 startup_urls->at(0) = sync_promo_url;
937 else 932 else
938 startup_urls->insert(startup_urls->begin(), sync_promo_url); 933 startup_urls->insert(startup_urls->begin(), sync_promo_url);
939 } 934 }
940 } 935 }
941 } 936 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/views/session_crashed_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698