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

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

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
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 "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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 const StartupTabs& tabs) { 705 const StartupTabs& tabs) {
706 DCHECK(!tabs.empty()); 706 DCHECK(!tabs.empty());
707 707
708 // If we don't yet have a profile, try to use the one we're given from 708 // If we don't yet have a profile, try to use the one we're given from
709 // |browser|. While we may not end up actually using |browser| (since it 709 // |browser|. While we may not end up actually using |browser| (since it
710 // could be a popup window), we can at least use the profile. 710 // could be a popup window), we can at least use the profile.
711 if (!profile_ && browser) 711 if (!profile_ && browser)
712 profile_ = browser->profile(); 712 profile_ = browser->profile();
713 713
714 if (!browser || !browser->is_type_tabbed()) { 714 if (!browser || !browser->is_type_tabbed()) {
715 browser = Browser::Create(profile_); 715 browser = new Browser(Browser::CreateParams(profile_));
716 } else { 716 } else {
717 #if defined(TOOLKIT_GTK) 717 #if defined(TOOLKIT_GTK)
718 // Setting the time of the last action on the window here allows us to steal 718 // Setting the time of the last action on the window here allows us to steal
719 // focus, which is what the user wants when opening a new tab in an existing 719 // focus, which is what the user wants when opening a new tab in an existing
720 // browser window. 720 // browser window.
721 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); 721 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow());
722 #endif 722 #endif
723 } 723 }
724 724
725 // In kiosk mode, we want to always be fullscreen, so switch to that now. 725 // In kiosk mode, we want to always be fullscreen, so switch to that now.
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 // New: 906 // New:
907 prefs->GetString(prefs::kHomePage), 907 prefs->GetString(prefs::kHomePage),
908 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), 908 prefs->GetBoolean(prefs::kHomePageIsNewTabPage),
909 prefs->GetBoolean(prefs::kShowHomeButton), 909 prefs->GetBoolean(prefs::kShowHomeButton),
910 // Backup: 910 // Backup:
911 backup_homepage, 911 backup_homepage,
912 backup_homepage_is_ntp, 912 backup_homepage_is_ntp,
913 backup_show_home_button)); 913 backup_show_home_button));
914 } 914 }
915 } 915 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698