| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 Browser* browser = nullptr; | 403 Browser* browser = nullptr; |
| 404 if (!has_tabbed_browser && | 404 if (!has_tabbed_browser && |
| 405 (*i)->type == sessions::SessionWindow::TYPE_TABBED) | 405 (*i)->type == sessions::SessionWindow::TYPE_TABBED) |
| 406 has_tabbed_browser = true; | 406 has_tabbed_browser = true; |
| 407 if (i == windows->begin() && | 407 if (i == windows->begin() && |
| 408 (*i)->type == sessions::SessionWindow::TYPE_TABBED && browser_ && | 408 (*i)->type == sessions::SessionWindow::TYPE_TABBED && browser_ && |
| 409 browser_->is_type_tabbed() && | 409 browser_->is_type_tabbed() && |
| 410 !browser_->profile()->IsOffTheRecord()) { | 410 !browser_->profile()->IsOffTheRecord()) { |
| 411 // The first set of tabs is added to the existing browser. | 411 // The first set of tabs is added to the existing browser. |
| 412 browser = browser_; | 412 browser = browser_; |
| 413 browser->set_is_used_for_session_restore(true); |
| 413 } else { | 414 } else { |
| 414 #if defined(OS_CHROMEOS) | 415 #if defined(OS_CHROMEOS) |
| 415 chromeos::BootTimesRecorder::Get()->AddLoginTimeMarker( | 416 chromeos::BootTimesRecorder::Get()->AddLoginTimeMarker( |
| 416 "SessionRestore-CreateRestoredBrowser-Start", false); | 417 "SessionRestore-CreateRestoredBrowser-Start", false); |
| 417 #endif | 418 #endif |
| 418 // Show the first window if none are visible. | 419 // Show the first window if none are visible. |
| 419 ui::WindowShowState show_state = (*i)->show_state; | 420 ui::WindowShowState show_state = (*i)->show_state; |
| 420 if (!has_visible_browser) { | 421 if (!has_visible_browser) { |
| 421 show_state = ui::SHOW_STATE_NORMAL; | 422 show_state = ui::SHOW_STATE_NORMAL; |
| 422 has_visible_browser = true; | 423 has_visible_browser = true; |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 // static | 881 // static |
| 881 base::CallbackList<void(int)>* | 882 base::CallbackList<void(int)>* |
| 882 SessionRestore::on_session_restored_callbacks_ = nullptr; | 883 SessionRestore::on_session_restored_callbacks_ = nullptr; |
| 883 | 884 |
| 884 // static | 885 // static |
| 885 base::ObserverList<SessionRestoreObserver>* SessionRestore::observers_ = | 886 base::ObserverList<SessionRestoreObserver>* SessionRestore::observers_ = |
| 886 nullptr; | 887 nullptr; |
| 887 | 888 |
| 888 // static | 889 // static |
| 889 bool SessionRestore::session_restore_started_ = false; | 890 bool SessionRestore::session_restore_started_ = false; |
| OLD | NEW |