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/sessions/session_restore.h" | 5 #include "chrome/browser/sessions/session_restore.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 // have been loaded. | 702 // have been loaded. |
703 // | 703 // |
704 // Returns the Browser that was created, if any. | 704 // Returns the Browser that was created, if any. |
705 Browser* FinishedTabCreation(bool succeeded, bool created_tabbed_browser) { | 705 Browser* FinishedTabCreation(bool succeeded, bool created_tabbed_browser) { |
706 Browser* browser = NULL; | 706 Browser* browser = NULL; |
707 if (!created_tabbed_browser && always_create_tabbed_browser_) { | 707 if (!created_tabbed_browser && always_create_tabbed_browser_) { |
708 browser = new Browser(Browser::CreateParams(profile_, | 708 browser = new Browser(Browser::CreateParams(profile_, |
709 host_desktop_type_)); | 709 host_desktop_type_)); |
710 if (urls_to_open_.empty()) { | 710 if (urls_to_open_.empty()) { |
711 // No tab browsers were created and no URLs were supplied on the command | 711 // No tab browsers were created and no URLs were supplied on the command |
712 // line. Add an empty URL, which is treated as opening the users home | 712 // line. Open the new tab page. |
713 // page. | 713 urls_to_open_.push_back(GURL(chrome::kChromeUINewTabURL)); |
714 urls_to_open_.push_back(GURL()); | |
715 } | 714 } |
716 AppendURLsToBrowser(browser, urls_to_open_); | 715 AppendURLsToBrowser(browser, urls_to_open_); |
717 browser->window()->Show(); | 716 browser->window()->Show(); |
718 } | 717 } |
719 | 718 |
720 if (succeeded) { | 719 if (succeeded) { |
721 DCHECK(tab_loader_.get()); | 720 DCHECK(tab_loader_.get()); |
722 // TabLoader deletes itself when done loading. | 721 // TabLoader deletes itself when done loading. |
723 tab_loader_->StartLoading(); | 722 tab_loader_->StartLoading(); |
724 tab_loader_ = NULL; | 723 tab_loader_ = NULL; |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 if (!active_session_restorers) | 1260 if (!active_session_restorers) |
1262 return false; | 1261 return false; |
1263 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1262 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1264 active_session_restorers->begin(); | 1263 active_session_restorers->begin(); |
1265 it != active_session_restorers->end(); ++it) { | 1264 it != active_session_restorers->end(); ++it) { |
1266 if ((*it)->synchronous()) | 1265 if ((*it)->synchronous()) |
1267 return true; | 1266 return true; |
1268 } | 1267 } |
1269 return false; | 1268 return false; |
1270 } | 1269 } |
OLD | NEW |