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 <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 if (browser_to_activate && browser_to_activate->is_type_tabbed()) | 451 if (browser_to_activate && browser_to_activate->is_type_tabbed()) |
452 last_browser = browser_to_activate; | 452 last_browser = browser_to_activate; |
453 | 453 |
454 if (last_browser && !urls_to_open_.empty()) | 454 if (last_browser && !urls_to_open_.empty()) |
455 AppendURLsToBrowser(last_browser, urls_to_open_); | 455 AppendURLsToBrowser(last_browser, urls_to_open_); |
456 #if defined(OS_CHROMEOS) | 456 #if defined(OS_CHROMEOS) |
457 chromeos::BootTimesRecorder::Get()->AddLoginTimeMarker( | 457 chromeos::BootTimesRecorder::Get()->AddLoginTimeMarker( |
458 "SessionRestore-CreatingTabs-End", false); | 458 "SessionRestore-CreatingTabs-End", false); |
459 #endif | 459 #endif |
460 if (browser_to_activate) | 460 if (browser_to_activate) { |
461 browser_to_activate->window()->Activate(); | 461 // TODO(johnme): Can we sometimes be certain this was for a user gesture? |
| 462 browser_to_activate->window()->Activate(false /* user_gesture */); |
| 463 } |
462 | 464 |
463 // If last_browser is NULL and urls_to_open_ is non-empty, | 465 // If last_browser is NULL and urls_to_open_ is non-empty, |
464 // FinishedTabCreation will create a new TabbedBrowser and add the urls to | 466 // FinishedTabCreation will create a new TabbedBrowser and add the urls to |
465 // it. | 467 // it. |
466 Browser* finished_browser = | 468 Browser* finished_browser = |
467 FinishedTabCreation(true, has_tabbed_browser, created_contents); | 469 FinishedTabCreation(true, has_tabbed_browser, created_contents); |
468 if (finished_browser) | 470 if (finished_browser) |
469 last_browser = finished_browser; | 471 last_browser = finished_browser; |
470 | 472 |
471 // sessionStorages needed for the session restore have now been recreated | 473 // sessionStorages needed for the session restore have now been recreated |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 if (prioritize_tabs == "mru") | 827 if (prioritize_tabs == "mru") |
826 return SMART_RESTORE_MODE_MRU; | 828 return SMART_RESTORE_MODE_MRU; |
827 if (prioritize_tabs == "simple") | 829 if (prioritize_tabs == "simple") |
828 return SMART_RESTORE_MODE_SIMPLE; | 830 return SMART_RESTORE_MODE_SIMPLE; |
829 return SMART_RESTORE_MODE_OFF; | 831 return SMART_RESTORE_MODE_OFF; |
830 } | 832 } |
831 | 833 |
832 // static | 834 // static |
833 base::CallbackList<void(int)>* | 835 base::CallbackList<void(int)>* |
834 SessionRestore::on_session_restored_callbacks_ = nullptr; | 836 SessionRestore::on_session_restored_callbacks_ = nullptr; |
OLD | NEW |