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

Side by Side Diff: chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc

Issue 2623273011: Move Chrome terminating notification out of //apps (Closed)
Patch Set: remove DEPS rule Created 3 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/apps/app_shim/extension_app_shim_handler_mac.h" 5 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h"
6 6
7 #include "apps/app_lifetime_monitor_factory.h" 7 #include "apps/app_lifetime_monitor_factory.h"
8 #include "apps/launcher.h" 8 #include "apps/launcher.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 if (host) 728 if (host)
729 host->OnAppClosed(); 729 host->OnAppClosed();
730 730
731 if (hosts_.empty()) 731 if (hosts_.empty())
732 delegate_->MaybeTerminate(); 732 delegate_->MaybeTerminate();
733 } 733 }
734 734
735 void ExtensionAppShimHandler::OnAppStop(Profile* profile, 735 void ExtensionAppShimHandler::OnAppStop(Profile* profile,
736 const std::string& app_id) {} 736 const std::string& app_id) {}
737 737
738 void ExtensionAppShimHandler::OnChromeTerminating() {}
739
740 // The BrowserWindow may be NULL when this is called. 738 // The BrowserWindow may be NULL when this is called.
741 // Therefore we listen for the notification 739 // Therefore we listen for the notification
742 // chrome::NOTIFICATION_BROWSER_WINDOW_READY and then call OnAppActivated. 740 // chrome::NOTIFICATION_BROWSER_WINDOW_READY and then call OnAppActivated.
743 // If this notification is removed, check that OnBrowserAdded is called after 741 // If this notification is removed, check that OnBrowserAdded is called after
744 // the BrowserWindow is ready. 742 // the BrowserWindow is ready.
745 void ExtensionAppShimHandler::OnBrowserAdded(Browser* browser) { 743 void ExtensionAppShimHandler::OnBrowserAdded(Browser* browser) {
746 } 744 }
747 745
748 void ExtensionAppShimHandler::OnBrowserRemoved(Browser* browser) { 746 void ExtensionAppShimHandler::OnBrowserRemoved(Browser* browser) {
749 const Extension* extension = MaybeGetAppForBrowser(browser); 747 const Extension* extension = MaybeGetAppForBrowser(browser);
750 if (!extension) 748 if (!extension)
751 return; 749 return;
752 750
753 AppBrowserMap::iterator it = app_browser_windows_.find(extension->id()); 751 AppBrowserMap::iterator it = app_browser_windows_.find(extension->id());
754 if (it != app_browser_windows_.end()) { 752 if (it != app_browser_windows_.end()) {
755 BrowserSet& browsers = it->second; 753 BrowserSet& browsers = it->second;
756 browsers.erase(browser); 754 browsers.erase(browser);
757 if (browsers.empty()) 755 if (browsers.empty())
758 OnAppDeactivated(browser->profile(), extension->id()); 756 OnAppDeactivated(browser->profile(), extension->id());
759 } 757 }
760 } 758 }
761 759
762 } // namespace apps 760 } // namespace apps
OLDNEW
« no previous file with comments | « chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h ('k') | chrome/browser/extensions/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698