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/ui/app_list/app_list_view_delegate.h" | 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "apps/custom_launcher_page_contents.h" | 9 #include "apps/custom_launcher_page_contents.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 void AppListViewDelegate::RemoveObserver( | 639 void AppListViewDelegate::RemoveObserver( |
640 app_list::AppListViewDelegateObserver* observer) { | 640 app_list::AppListViewDelegateObserver* observer) { |
641 observers_.RemoveObserver(observer); | 641 observers_.RemoveObserver(observer); |
642 } | 642 } |
643 | 643 |
644 void AppListViewDelegate::Observe(int type, | 644 void AppListViewDelegate::Observe(int type, |
645 const content::NotificationSource& source, | 645 const content::NotificationSource& source, |
646 const content::NotificationDetails& details) { | 646 const content::NotificationDetails& details) { |
647 switch (type) { | 647 switch (type) { |
648 case chrome::NOTIFICATION_APP_TERMINATING: | 648 case chrome::NOTIFICATION_APP_TERMINATING: |
| 649 FOR_EACH_OBSERVER( |
| 650 app_list::AppListViewDelegateObserver, observers_, OnShutdown()); |
| 651 |
649 SetProfile(NULL); // Ensures launcher page web contents are torn down. | 652 SetProfile(NULL); // Ensures launcher page web contents are torn down. |
650 | 653 |
651 // SigninManagerFactory is not a leaky singleton (unlike this class), and | 654 // SigninManagerFactory is not a leaky singleton (unlike this class), and |
652 // its destructor will check that it has no remaining observers. | 655 // its destructor will check that it has no remaining observers. |
653 scoped_observer_.RemoveAll(); | 656 scoped_observer_.RemoveAll(); |
654 SigninManagerFactory::GetInstance()->RemoveObserver(this); | 657 SigninManagerFactory::GetInstance()->RemoveObserver(this); |
655 break; | 658 break; |
656 default: | 659 default: |
657 NOTREACHED(); | 660 NOTREACHED(); |
658 } | 661 } |
659 } | 662 } |
OLD | NEW |