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

Unified Diff: apps/app_shim/app_shim_handler_mac.h

Issue 15269003: Refactor extension handling code from AppShimHost into ExtensionAppShimHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Instantiate ExtensionAppShimHandler in AppShimHostManager. Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | apps/app_shim/app_shim_handler_mac.cc » ('j') | apps/app_shim/app_shim_host_mac.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | apps/app_shim/app_shim_handler_mac.cc » ('j') | apps/app_shim/app_shim_host_mac.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698