| Index: chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h
|
| diff --git a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h
|
| index 8ac49432086d84b5748090b73365b6e842bbeaa2..46b70d3669d8c0e80a0372df98d20d2d23c9e1f7 100644
|
| --- a/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h
|
| +++ b/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h
|
| @@ -6,13 +6,17 @@
|
| #define CHROME_BROWSER_APPS_APP_SHIM_EXTENSION_APP_SHIM_HANDLER_MAC_H_
|
|
|
| #include <map>
|
| +#include <set>
|
| #include <string>
|
| #include <vector>
|
|
|
| +
|
| #include "apps/app_lifetime_monitor.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "chrome/browser/apps/app_shim/app_shim_handler_mac.h"
|
| +#include "chrome/browser/ui/browser.h"
|
| +#include "chrome/browser/ui/browser_list_observer.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| #include "extensions/browser/app_window/app_window_registry.h"
|
| @@ -38,7 +42,8 @@ namespace apps {
|
| // extension.
|
| class ExtensionAppShimHandler : public AppShimHandler,
|
| public content::NotificationObserver,
|
| - public AppLifetimeMonitor::Observer {
|
| + public AppLifetimeMonitor::Observer,
|
| + public chrome::BrowserListObserver {
|
| public:
|
| class Delegate {
|
| public:
|
| @@ -74,8 +79,13 @@ class ExtensionAppShimHandler : public AppShimHandler,
|
|
|
| static void QuitAppForWindow(extensions::AppWindow* app_window);
|
|
|
| + static void QuitHostedAppForWindow(Browser* browser,
|
| + const extensions::Extension* extension);
|
| +
|
| static void HideAppForWindow(extensions::AppWindow* app_window);
|
|
|
| + static void HideHostedApp(Profile* profile, const std::string& app_id);
|
| +
|
| static void FocusAppForWindow(extensions::AppWindow* app_window);
|
|
|
| // Brings the window to the front without showing it and instructs the shim to
|
| @@ -115,9 +125,15 @@ class ExtensionAppShimHandler : public AppShimHandler,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) override;
|
|
|
| + // chrome::BrowserListObserver overrides;
|
| + void OnBrowserAdded(Browser* browser) override;
|
| + void OnBrowserRemoved(Browser* browser) override;
|
| +
|
| protected:
|
| typedef std::map<std::pair<Profile*, std::string>, AppShimHandler::Host*>
|
| HostMap;
|
| + typedef std::set<Browser*> BrowserSet;
|
| + typedef std::map<std::string, BrowserSet> AppBrowserMap;
|
|
|
| // Exposed for testing.
|
| void set_delegate(Delegate* delegate);
|
| @@ -145,6 +161,9 @@ class ExtensionAppShimHandler : public AppShimHandler,
|
|
|
| HostMap hosts_;
|
|
|
| + // A map of app ids to associated browser windows.
|
| + AppBrowserMap app_browser_windows_;
|
| +
|
| content::NotificationRegistrar registrar_;
|
|
|
| base::WeakPtrFactory<ExtensionAppShimHandler> weak_factory_;
|
|
|