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..65af734aeef34d1372a74c890b45af2ce379c3d4 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,6 +6,7 @@ |
#define CHROME_BROWSER_APPS_APP_SHIM_EXTENSION_APP_SHIM_HANDLER_MAC_H_ |
#include <map> |
+#include <set> |
#include <string> |
#include <vector> |
@@ -13,6 +14,8 @@ |
#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 +41,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,10 +78,23 @@ 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); |
+ |
+ void SetHostedAppHidden(Profile* profile, |
jackhou1
2014/12/12 00:48:29
Move this below FindHost.
mitchellj
2014/12/12 03:46:23
Done.
|
+ const std::string& app_id, |
+ bool hidden); |
+ |
static void FocusAppForWindow(extensions::AppWindow* app_window); |
+ const static extensions::Extension* GetAppExtension( |
jackhou1
2014/12/12 00:48:29
s/const static/static const/
Also move this so th
mitchellj
2014/12/12 03:46:23
Done.
|
+ Profile* profile, |
+ const std::string& extension_id); |
+ |
// Brings the window to the front without showing it and instructs the shim to |
// request user attention. If there is no shim, show the app and return false. |
static bool ActivateAndRequestUserAttentionForWindow( |
@@ -115,9 +132,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 +168,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_; |