| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_ | 5 #ifndef APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_ |
| 6 #define APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_ | 6 #define APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 class Profile; | 10 class Profile; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // none registered, it returns the default handler or NULL if there is no | 39 // none registered, it returns the default handler or NULL if there is no |
| 40 // default handler. | 40 // default handler. |
| 41 static AppShimHandler* GetForAppMode(const std::string& app_mode_id); | 41 static AppShimHandler* GetForAppMode(const std::string& app_mode_id); |
| 42 | 42 |
| 43 // Sets the default handler to return when there is no app-specific handler. | 43 // Sets the default handler to return when there is no app-specific handler. |
| 44 // Setting this to NULL removes the default handler. | 44 // Setting this to NULL removes the default handler. |
| 45 static void SetDefaultHandler(AppShimHandler* handler); | 45 static void SetDefaultHandler(AppShimHandler* handler); |
| 46 | 46 |
| 47 // Invoked by the shim host when the shim process is launched. The handler | 47 // Invoked by the shim host when the shim process is launched. The handler |
| 48 // must return true if successful, or false to indicate back to the shim | 48 // must return true if successful, or false to indicate back to the shim |
| 49 // process that it should close. | 49 // process that it should close. |launch_now| indicates whether to launch the |
| 50 virtual bool OnShimLaunch(Host* host) = 0; | 50 // associated app. |
| 51 virtual bool OnShimLaunch(Host* host, bool launch_now) = 0; |
| 51 | 52 |
| 52 // Invoked by the shim host when the connection to the shim process is closed. | 53 // Invoked by the shim host when the connection to the shim process is closed. |
| 53 virtual void OnShimClose(Host* host) = 0; | 54 virtual void OnShimClose(Host* host) = 0; |
| 54 | 55 |
| 55 // Invoked by the shim host when the shim process receives a focus event. | 56 // Invoked by the shim host when the shim process receives a focus event. |
| 56 virtual void OnShimFocus(Host* host) = 0; | 57 virtual void OnShimFocus(Host* host) = 0; |
| 57 | 58 |
| 58 protected: | 59 protected: |
| 59 AppShimHandler() {} | 60 AppShimHandler() {} |
| 60 virtual ~AppShimHandler() {} | 61 virtual ~AppShimHandler() {} |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 } // namespace apps | 64 } // namespace apps |
| 64 | 65 |
| 65 #endif // APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_ | 66 #endif // APPS_APP_SHIM_APP_SHIM_HANDLER_MAC_H_ |
| OLD | NEW |