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

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: Add default handler to AppShimHandler. Fix test. 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_handler_mac.cc » ('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..c0fc87ac47d438e112bddde320688d6084a52d28 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* profile() const = 0;
tapted 2013/05/21 06:15:37 Since there is no corresponding data member at thi
jackhou1 2013/05/22 23:54:44 Done.
+ virtual const std::string& app_id() const = 0;
tapted 2013/05/21 06:15:37 nit: Maybe drop the reference and just return std:
jackhou1 2013/05/22 23:54:44 Done.
+
protected:
virtual ~Host() {}
};
@@ -29,10 +35,14 @@ 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|, or the default
+ // handler if none is registered, or NULL if there is no default handler.
tapted 2013/05/21 06:15:37 nit: comment reads a bit funny. Maybe just drop th
jackhou1 2013/05/22 23:54:44 Done.
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_handler_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698