OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 bool always_create_tabbed_browser, | 417 bool always_create_tabbed_browser, |
418 const std::vector<GURL>& urls_to_open) { | 418 const std::vector<GURL>& urls_to_open) { |
419 DCHECK(profile); | 419 DCHECK(profile); |
420 // Always restore from the original profile (incognito profiles have no | 420 // Always restore from the original profile (incognito profiles have no |
421 // session service). | 421 // session service). |
422 profile = profile->GetOriginalProfile(); | 422 profile = profile->GetOriginalProfile(); |
423 if (!profile->GetSessionService()) { | 423 if (!profile->GetSessionService()) { |
424 NOTREACHED(); | 424 NOTREACHED(); |
425 return; | 425 return; |
426 } | 426 } |
| 427 profile->set_restored_last_session(true); |
427 // SessionRestoreImpl takes care of deleting itself when done. | 428 // SessionRestoreImpl takes care of deleting itself when done. |
428 SessionRestoreImpl* restorer = | 429 SessionRestoreImpl* restorer = |
429 new SessionRestoreImpl(profile, browser, synchronous, | 430 new SessionRestoreImpl(profile, browser, synchronous, |
430 clobber_existing_window, | 431 clobber_existing_window, |
431 always_create_tabbed_browser, urls_to_open); | 432 always_create_tabbed_browser, urls_to_open); |
432 restorer->Restore(); | 433 restorer->Restore(); |
433 } | 434 } |
434 | 435 |
435 // static | 436 // static |
436 void SessionRestore::RestoreSession(Profile* profile, | 437 void SessionRestore::RestoreSession(Profile* profile, |
437 Browser* browser, | 438 Browser* browser, |
438 bool clobber_existing_window, | 439 bool clobber_existing_window, |
439 bool always_create_tabbed_browser, | 440 bool always_create_tabbed_browser, |
440 const std::vector<GURL>& urls_to_open) { | 441 const std::vector<GURL>& urls_to_open) { |
441 Restore(profile, browser, false, clobber_existing_window, | 442 Restore(profile, browser, false, clobber_existing_window, |
442 always_create_tabbed_browser, urls_to_open); | 443 always_create_tabbed_browser, urls_to_open); |
443 } | 444 } |
444 | 445 |
445 // static | 446 // static |
446 void SessionRestore::RestoreSessionSynchronously( | 447 void SessionRestore::RestoreSessionSynchronously( |
447 Profile* profile, | 448 Profile* profile, |
448 const std::vector<GURL>& urls_to_open) { | 449 const std::vector<GURL>& urls_to_open) { |
449 Restore(profile, NULL, true, false, true, urls_to_open); | 450 Restore(profile, NULL, true, false, true, urls_to_open); |
450 } | 451 } |
OLD | NEW |