| 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 CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_MAC_H_ | 5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_MAC_H_ |
| 6 #define CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_MAC_H_ | 6 #define CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "apps/app_shim/app_shim_handler_mac.h" | 10 #include "apps/app_shim/app_shim_handler_mac.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 virtual Profile* FetchProfileForDirectory(const std::string& profile_dir); | 44 virtual Profile* FetchProfileForDirectory(const std::string& profile_dir); |
| 45 | 45 |
| 46 // IPC::Listener implementation. | 46 // IPC::Listener implementation. |
| 47 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 47 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 48 virtual void OnChannelError() OVERRIDE; | 48 virtual void OnChannelError() OVERRIDE; |
| 49 | 49 |
| 50 // IPC::Sender implementation. | 50 // IPC::Sender implementation. |
| 51 virtual bool Send(IPC::Message* message) OVERRIDE; | 51 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // The app shim process is requesting that an app be launched. Once it has | 54 // The app shim process is requesting to be associated with the given profile |
| 55 // done so the |profile| and |app_id| are stored, and all future messages | 55 // and app_id. Once the profile and app_id are stored, and all future |
| 56 // from the app shim relate to the app it launched. It is an error for the | 56 // messages from the app shim relate to this app. The app is launched |
| 57 // app shim to send multiple launch messages. | 57 // immediately if |launch_now| is true. |
| 58 void OnLaunchApp(std::string profile, std::string app_id); | 58 void OnLaunchApp(std::string profile_dir, |
| 59 std::string app_id, |
| 60 bool launch_now); |
| 59 | 61 |
| 60 // Called when the app shim process notifies that the app should be brought | 62 // Called when the app shim process notifies that the app should be brought |
| 61 // to the front (i.e. the user has clicked on the app's icon in the dock or | 63 // to the front (i.e. the user has clicked on the app's icon in the dock or |
| 62 // Cmd+Tabbed to it.) | 64 // Cmd+Tabbed to it.) |
| 63 void OnFocus(); | 65 void OnFocus(); |
| 64 | 66 |
| 65 // apps::AppShimHandler::Host overrides: | 67 // apps::AppShimHandler::Host overrides: |
| 66 virtual void OnAppClosed() OVERRIDE; | 68 virtual void OnAppClosed() OVERRIDE; |
| 67 virtual Profile* GetProfile() const OVERRIDE; | 69 virtual Profile* GetProfile() const OVERRIDE; |
| 68 virtual std::string GetAppId() const OVERRIDE; | 70 virtual std::string GetAppId() const OVERRIDE; |
| 69 | 71 |
| 70 // Closes the channel and destroys the AppShimHost. | 72 // Closes the channel and destroys the AppShimHost. |
| 71 void Close(); | 73 void Close(); |
| 72 | 74 |
| 73 scoped_ptr<IPC::ChannelProxy> channel_; | 75 scoped_ptr<IPC::ChannelProxy> channel_; |
| 74 std::string app_id_; | 76 std::string app_id_; |
| 75 Profile* profile_; | 77 Profile* profile_; |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 #endif // CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_MAC_H_ | 80 #endif // CHROME_BROWSER_WEB_APPLICATIONS_APP_SHIM_HOST_MAC_H_ |
| OLD | NEW |