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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 if (!app_name.empty()) { | 634 if (!app_name.empty()) { |
635 const bool trusted_source = true; // We only store trusted app windows. | 635 const bool trusted_source = true; // We only store trusted app windows. |
636 params = Browser::CreateParams::CreateForApp(app_name, trusted_source, | 636 params = Browser::CreateParams::CreateForApp(app_name, trusted_source, |
637 bounds, profile_); | 637 bounds, profile_); |
638 } else { | 638 } else { |
639 params.initial_bounds = bounds; | 639 params.initial_bounds = bounds; |
640 } | 640 } |
641 params.initial_show_state = show_state; | 641 params.initial_show_state = show_state; |
642 params.initial_workspace = workspace; | 642 params.initial_workspace = workspace; |
643 params.is_session_restore = true; | 643 params.is_session_restore = true; |
| 644 params.user_gesture = false; |
644 return new Browser(params); | 645 return new Browser(params); |
645 } | 646 } |
646 | 647 |
647 void ShowBrowser(Browser* browser, int selected_tab_index) { | 648 void ShowBrowser(Browser* browser, int selected_tab_index) { |
648 DCHECK(browser); | 649 DCHECK(browser); |
649 DCHECK(browser->tab_strip_model()->count()); | 650 DCHECK(browser->tab_strip_model()->count()); |
650 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); | 651 browser->tab_strip_model()->ActivateTabAt(selected_tab_index, true); |
651 | 652 |
652 if (browser_ == browser) | 653 if (browser_ == browser) |
653 return; | 654 return; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 // static | 846 // static |
846 SessionRestore::CallbackSubscription | 847 SessionRestore::CallbackSubscription |
847 SessionRestore::RegisterOnSessionRestoredCallback( | 848 SessionRestore::RegisterOnSessionRestoredCallback( |
848 const base::Callback<void(int)>& callback) { | 849 const base::Callback<void(int)>& callback) { |
849 return on_session_restored_callbacks()->Add(callback); | 850 return on_session_restored_callbacks()->Add(callback); |
850 } | 851 } |
851 | 852 |
852 // static | 853 // static |
853 base::CallbackList<void(int)>* | 854 base::CallbackList<void(int)>* |
854 SessionRestore::on_session_restored_callbacks_ = nullptr; | 855 SessionRestore::on_session_restored_callbacks_ = nullptr; |
OLD | NEW |