Index: apps/app_shim/app_shim_handler_mac.h |
diff --git a/apps/app_shim/app_shim_handler_mac.h b/apps/app_shim/app_shim_handler_mac.h |
index 6a694c0a0a3107e88e106229af8cc7bf3d4be880..507fe5f8410b055ea8f5cd26d3a3fcbb0ca6566d 100644 |
--- a/apps/app_shim/app_shim_handler_mac.h |
+++ b/apps/app_shim/app_shim_handler_mac.h |
@@ -7,6 +7,8 @@ |
#include <string> |
+class Profile; |
+ |
namespace apps { |
// Registrar, and interface for services that can handle interactions with OSX |
@@ -18,6 +20,10 @@ class AppShimHandler { |
// Invoked when the app is closed in the browser process. |
virtual void OnAppClosed() = 0; |
+ // Allows the handler to determine which app this host corresponds to. |
+ virtual Profile* GetProfile() const = 0; |
+ virtual std::string GetAppId() const = 0; |
+ |
protected: |
virtual ~Host() {} |
}; |
@@ -29,10 +35,15 @@ class AppShimHandler { |
// Remove a handler for an |app_mode_id|. |
static void RemoveHandler(const std::string& app_mode_id); |
- // Returns the handler registered for the given |app_mode_id|, or NULL if none |
- // is registered. |
+ // Returns the handler registered for the given |app_mode_id|. If there is |
+ // none registered, it returns the default handler or NULL if there is no |
+ // default handler. |
static AppShimHandler* GetForAppMode(const std::string& app_mode_id); |
+ // Sets the default handler to return when there is no app-specific handler. |
+ // Setting this to NULL removes the default handler. |
+ static void SetDefaultHandler(AppShimHandler* handler); |
+ |
// Invoked by the shim host when the shim process is launched. The handler |
// must return true if successful, or false to indicate back to the shim |
// process that it should close. |