1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_
6 #define APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_
12 // Registrar, and interface for services that can handle interactions with OSX
14 class AppShimHandler
{
18 // Invoked when the app is closed in the browser process.
19 virtual void OnAppClosed() = 0;
25 // Register a handler for an |app_mode_id|.
26 static void RegisterHandler(const std::string
& app_mode_id
,
27 AppShimHandler
* handler
);
29 // Remove a handler for an |app_mode_id|.
30 static void RemoveHandler(const std::string
& app_mode_id
);
32 // Returns the handler registered for the given |app_mode_id|, or NULL if none
34 static AppShimHandler
* GetForAppMode(const std::string
& app_mode_id
);
36 // Invoked by the shim host when the shim process is launched. The handler
37 // must return true if successful, or false to indicate back to the shim
38 // process that it should close.
39 virtual bool OnShimLaunch(Host
* host
) = 0;
41 // Invoked by the shim host when the connection to the shim process is closed.
42 virtual void OnShimClose(Host
* host
) = 0;
44 // Invoked by the shim host when the shim process receives a focus event.
45 virtual void OnShimFocus(Host
* host
) = 0;
49 virtual ~AppShimHandler() {}
54 #endif // APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_