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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
711 first_tab = false; | 711 first_tab = false; |
712 } | 712 } |
713 if (!chrome::GetActiveWebContents(browser)) { | 713 if (!chrome::GetActiveWebContents(browser)) { |
714 // TODO: this is a work around for 110909. Figure out why it's needed. | 714 // TODO: this is a work around for 110909. Figure out why it's needed. |
715 if (!browser->tab_count()) | 715 if (!browser->tab_count()) |
716 browser->AddBlankTab(true); | 716 browser->AddBlankTab(true); |
717 else | 717 else |
718 chrome::ActivateTabAt(browser, 0, false); | 718 chrome::ActivateTabAt(browser, 0, false); |
719 } | 719 } |
720 | 720 |
721 browser->window()->Show(); | 721 // If we expect modal dialog to show, showing the browser has to be supressed |
722 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial | 722 // for now. The start sequence will then take care of showing it. |
723 // focus explicitly. | 723 bool as_first_run = is_first_run_ || |
grt (UTC plus 2)
2012/07/05 20:08:47
as discussed in person, i think it's cleaner to mo
motek.
2012/08/08 14:28:35
Moved to the creator, but as a simple setter/gette
| |
724 chrome::GetActiveWebContents(browser)->GetView()->SetInitialFocus(); | 724 command_line_.HasSwitch(switches::kFirstRun); |
725 if (!chrome::ExpectDefaultBrowserPromptDialog(profile_, as_first_run)) { | |
726 browser->window()->Show(); | |
727 // TODO(jcampan): http://crbug.com/8123 we should not need to set the | |
728 // initial focus explicitly. | |
729 chrome::GetActiveWebContents(browser)->GetView()->SetInitialFocus(); | |
730 } | |
725 | 731 |
726 return browser; | 732 return browser; |
727 } | 733 } |
728 | 734 |
729 void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( | 735 void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( |
730 Browser* browser, | 736 Browser* browser, |
731 chrome::startup::IsProcessStartup is_process_startup) { | 737 chrome::startup::IsProcessStartup is_process_startup) { |
732 if (!browser || !profile_ || browser->tab_count() == 0) | 738 if (!browser || !profile_ || browser->tab_count() == 0) |
733 return; | 739 return; |
734 | 740 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
860 // New: | 866 // New: |
861 prefs->GetString(prefs::kHomePage), | 867 prefs->GetString(prefs::kHomePage), |
862 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 868 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
863 prefs->GetBoolean(prefs::kShowHomeButton), | 869 prefs->GetBoolean(prefs::kShowHomeButton), |
864 // Backup: | 870 // Backup: |
865 backup_homepage, | 871 backup_homepage, |
866 backup_homepage_is_ntp, | 872 backup_homepage_is_ntp, |
867 backup_show_home_button)); | 873 backup_show_home_button)); |
868 } | 874 } |
869 } | 875 } |
OLD | NEW |