Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 593563002: For Mac, add AppListViewDelegateObserver::OnShutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl format, nits Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_mac_interactive_uitest.mm ('k') | ui/app_list/app_list_item_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698