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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 it != active_session_restorers->end(); ++it) { | 124 it != active_session_restorers->end(); ++it) { |
125 if ((*it)->profile_ == profile) | 125 if ((*it)->profile_ == profile) |
126 break; | 126 break; |
127 } | 127 } |
128 DCHECK(it == active_session_restorers->end()); | 128 DCHECK(it == active_session_restorers->end()); |
129 | 129 |
130 active_session_restorers->insert(this); | 130 active_session_restorers->insert(this); |
131 | 131 |
132 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::SESSION_RESTORE, | 132 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::SESSION_RESTORE, |
133 KeepAliveRestartOption::DISABLED)); | 133 KeepAliveRestartOption::DISABLED)); |
134 for (auto& observer : SessionRestore::observers()) | |
135 observer.OnSessionRestoreStartedLoadingTabs(); | |
ducbui
2017/07/04 05:34:39
I move the start of session restore to here. There
ducbui
2017/07/04 15:28:25
The revision of the session restore start signal d
| |
134 } | 136 } |
135 | 137 |
136 bool synchronous() const { return synchronous_; } | 138 bool synchronous() const { return synchronous_; } |
137 | 139 |
138 Browser* Restore() { | 140 Browser* Restore() { |
139 SessionService* session_service = | 141 SessionService* session_service = |
140 SessionServiceFactory::GetForProfile(profile_); | 142 SessionServiceFactory::GetForProfile(profile_); |
141 DCHECK(session_service); | 143 DCHECK(session_service); |
142 session_service->GetLastSession( | 144 session_service->GetLastSession( |
143 base::Bind(&SessionRestoreImpl::OnGotSession, base::Unretained(this)), | 145 base::Bind(&SessionRestoreImpl::OnGotSession, base::Unretained(this)), |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
874 observers().RemoveObserver(observer); | 876 observers().RemoveObserver(observer); |
875 } | 877 } |
876 | 878 |
877 // static | 879 // static |
878 base::CallbackList<void(int)>* | 880 base::CallbackList<void(int)>* |
879 SessionRestore::on_session_restored_callbacks_ = nullptr; | 881 SessionRestore::on_session_restored_callbacks_ = nullptr; |
880 | 882 |
881 // static | 883 // static |
882 base::ObserverList<SessionRestoreObserver>* SessionRestore::observers_ = | 884 base::ObserverList<SessionRestoreObserver>* SessionRestore::observers_ = |
883 nullptr; | 885 nullptr; |
OLD | NEW |