OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 10 #include <vector> |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 // to an already existing browser and an existing tab painted. | 314 // to an already existing browser and an existing tab painted. |
315 got_first_paint_ = true; | 315 got_first_paint_ = true; |
316 } | 316 } |
317 } | 317 } |
318 break; | 318 break; |
319 } | 319 } |
320 default: | 320 default: |
321 NOTREACHED() << "Unknown notification received:" << type.value; | 321 NOTREACHED() << "Unknown notification received:" << type.value; |
322 } | 322 } |
323 // Delete ourselves when we're not waiting for any more notifications. | 323 // Delete ourselves when we're not waiting for any more notifications. |
324 if (got_first_paint_&& tabs_loading_.empty() && tabs_to_load_.empty()) | 324 if ((got_first_paint_ || render_widget_hosts_to_paint_.empty()) && |
| 325 tabs_loading_.empty() && tabs_to_load_.empty()) |
325 delete this; | 326 delete this; |
326 } | 327 } |
327 | 328 |
328 void TabLoader::RemoveTab(NavigationController* tab) { | 329 void TabLoader::RemoveTab(NavigationController* tab) { |
329 registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED, | 330 registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED, |
330 Source<TabContents>(tab->tab_contents())); | 331 Source<TabContents>(tab->tab_contents())); |
331 registrar_.Remove(this, NotificationType::LOAD_STOP, | 332 registrar_.Remove(this, NotificationType::LOAD_STOP, |
332 Source<NavigationController>(tab)); | 333 Source<NavigationController>(tab)); |
333 registrar_.Remove(this, NotificationType::LOAD_START, | 334 registrar_.Remove(this, NotificationType::LOAD_START, |
334 Source<NavigationController>(tab)); | 335 Source<NavigationController>(tab)); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 void SessionRestore::RestoreSessionSynchronously( | 815 void SessionRestore::RestoreSessionSynchronously( |
815 Profile* profile, | 816 Profile* profile, |
816 const std::vector<GURL>& urls_to_open) { | 817 const std::vector<GURL>& urls_to_open) { |
817 Restore(profile, NULL, true, false, true, urls_to_open); | 818 Restore(profile, NULL, true, false, true, urls_to_open); |
818 } | 819 } |
819 | 820 |
820 // static | 821 // static |
821 bool SessionRestore::IsRestoring() { | 822 bool SessionRestore::IsRestoring() { |
822 return restoring; | 823 return restoring; |
823 } | 824 } |
OLD | NEW |