Chromium Code Reviews| 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 // If the first set of tabs belongs to minimized browser, the existing | |
| 414 // browser should be minimized to keep consistent show state. | |
| 415 if ((*i)->show_state == ui::SHOW_STATE_MINIMIZED) | |
|
sky
2017/02/23 21:41:06
If there is only one window, I think we should not
Qiang(Joe) Xu
2017/03/06 22:36:03
Yes, I agree. We shall not minimize here.
Another
| |
| 416 browser->window()->Minimize(); | |
| 413 } else { | 417 } else { |
| 414 #if defined(OS_CHROMEOS) | 418 #if defined(OS_CHROMEOS) |
| 415 chromeos::BootTimesRecorder::Get()->AddLoginTimeMarker( | 419 chromeos::BootTimesRecorder::Get()->AddLoginTimeMarker( |
| 416 "SessionRestore-CreateRestoredBrowser-Start", false); | 420 "SessionRestore-CreateRestoredBrowser-Start", false); |
| 417 #endif | 421 #endif |
| 418 // Show the first window if none are visible. | 422 // Show the first window if none are visible. |
| 419 ui::WindowShowState show_state = (*i)->show_state; | 423 ui::WindowShowState show_state = (*i)->show_state; |
| 420 if (!has_visible_browser) { | 424 if (!has_visible_browser) { |
| 421 show_state = ui::SHOW_STATE_NORMAL; | 425 show_state = ui::SHOW_STATE_NORMAL; |
| 422 has_visible_browser = true; | 426 has_visible_browser = true; |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 844 // static | 848 // static |
| 845 SessionRestore::CallbackSubscription | 849 SessionRestore::CallbackSubscription |
| 846 SessionRestore::RegisterOnSessionRestoredCallback( | 850 SessionRestore::RegisterOnSessionRestoredCallback( |
| 847 const base::Callback<void(int)>& callback) { | 851 const base::Callback<void(int)>& callback) { |
| 848 return on_session_restored_callbacks()->Add(callback); | 852 return on_session_restored_callbacks()->Add(callback); |
| 849 } | 853 } |
| 850 | 854 |
| 851 // static | 855 // static |
| 852 base::CallbackList<void(int)>* | 856 base::CallbackList<void(int)>* |
| 853 SessionRestore::on_session_restored_callbacks_ = nullptr; | 857 SessionRestore::on_session_restored_callbacks_ = nullptr; |
| OLD | NEW |