OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 browser->window()->Show(); | 642 browser->window()->Show(); |
643 } | 643 } |
644 NotifySessionServiceOfRestoredTabs(browser, | 644 NotifySessionServiceOfRestoredTabs(browser, |
645 browser->tab_strip_model()->count()); | 645 browser->tab_strip_model()->count()); |
646 | 646 |
647 // Since FinishedTabCreation() is not called here, |this| will leak if we | 647 // Since FinishedTabCreation() is not called here, |this| will leak if we |
648 // are not in sychronous mode. | 648 // are not in sychronous mode. |
649 DCHECK(synchronous_); | 649 DCHECK(synchronous_); |
650 } | 650 } |
651 | 651 |
652 ~SessionRestoreImpl() { | 652 virtual ~SessionRestoreImpl() { |
653 STLDeleteElements(&windows_); | 653 STLDeleteElements(&windows_); |
654 | 654 |
655 active_session_restorers->erase(this); | 655 active_session_restorers->erase(this); |
656 if (active_session_restorers->empty()) { | 656 if (active_session_restorers->empty()) { |
657 delete active_session_restorers; | 657 delete active_session_restorers; |
658 active_session_restorers = NULL; | 658 active_session_restorers = NULL; |
659 } | 659 } |
660 | 660 |
661 g_browser_process->ReleaseModule(); | 661 g_browser_process->ReleaseModule(); |
662 } | 662 } |
663 | 663 |
664 virtual void Observe(int type, | 664 virtual void Observe(int type, |
665 const content::NotificationSource& source, | 665 const content::NotificationSource& source, |
666 const content::NotificationDetails& details) { | 666 const content::NotificationDetails& details) OVERRIDE { |
667 switch (type) { | 667 switch (type) { |
668 case chrome::NOTIFICATION_BROWSER_CLOSED: | 668 case chrome::NOTIFICATION_BROWSER_CLOSED: |
669 delete this; | 669 delete this; |
670 return; | 670 return; |
671 | 671 |
672 default: | 672 default: |
673 NOTREACHED(); | 673 NOTREACHED(); |
674 break; | 674 break; |
675 } | 675 } |
676 } | 676 } |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 if (!active_session_restorers) | 1226 if (!active_session_restorers) |
1227 return false; | 1227 return false; |
1228 for (std::set<SessionRestoreImpl*>::const_iterator it = | 1228 for (std::set<SessionRestoreImpl*>::const_iterator it = |
1229 active_session_restorers->begin(); | 1229 active_session_restorers->begin(); |
1230 it != active_session_restorers->end(); ++it) { | 1230 it != active_session_restorers->end(); ++it) { |
1231 if ((*it)->synchronous()) | 1231 if ((*it)->synchronous()) |
1232 return true; | 1232 return true; |
1233 } | 1233 } |
1234 return false; | 1234 return false; |
1235 } | 1235 } |
OLD | NEW |