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_APPS_APP_SHIM_APP_SHIM_HOST_MAC_H_ | 5 #ifndef CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MAC_H_ |
6 #define CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MAC_H_ | 6 #define CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MAC_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 AppShimHost(); | 33 AppShimHost(); |
34 virtual ~AppShimHost(); | 34 virtual ~AppShimHost(); |
35 | 35 |
36 // Creates a new server-side IPC channel at |handle|, which should contain a | 36 // Creates a new server-side IPC channel at |handle|, which should contain a |
37 // file descriptor of a channel created by an UnixDomainSocketAcceptor, | 37 // file descriptor of a channel created by an UnixDomainSocketAcceptor, |
38 // and begins listening for messages on it. | 38 // and begins listening for messages on it. |
39 void ServeChannel(const IPC::ChannelHandle& handle); | 39 void ServeChannel(const IPC::ChannelHandle& handle); |
40 | 40 |
41 protected: | 41 protected: |
42 // IPC::Listener implementation. | 42 // IPC::Listener implementation. |
43 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 43 virtual bool OnMessageReceived(const IPC::Message& message) override; |
44 virtual void OnChannelError() OVERRIDE; | 44 virtual void OnChannelError() override; |
45 | 45 |
46 // IPC::Sender implementation. | 46 // IPC::Sender implementation. |
47 virtual bool Send(IPC::Message* message) OVERRIDE; | 47 virtual bool Send(IPC::Message* message) override; |
48 | 48 |
49 private: | 49 private: |
50 // The app shim process is requesting to be associated with the given profile | 50 // The app shim process is requesting to be associated with the given profile |
51 // and app_id. Once the profile and app_id are stored, and all future | 51 // and app_id. Once the profile and app_id are stored, and all future |
52 // messages from the app shim relate to this app. The app is launched | 52 // messages from the app shim relate to this app. The app is launched |
53 // immediately if |launch_now| is true. | 53 // immediately if |launch_now| is true. |
54 void OnLaunchApp(const base::FilePath& profile_dir, | 54 void OnLaunchApp(const base::FilePath& profile_dir, |
55 const std::string& app_id, | 55 const std::string& app_id, |
56 apps::AppShimLaunchType launch_type, | 56 apps::AppShimLaunchType launch_type, |
57 const std::vector<base::FilePath>& files); | 57 const std::vector<base::FilePath>& files); |
58 | 58 |
59 // Called when the app shim process notifies that the app was focused. | 59 // Called when the app shim process notifies that the app was focused. |
60 void OnFocus(apps::AppShimFocusType focus_type, | 60 void OnFocus(apps::AppShimFocusType focus_type, |
61 const std::vector<base::FilePath>& files); | 61 const std::vector<base::FilePath>& files); |
62 | 62 |
63 void OnSetHidden(bool hidden); | 63 void OnSetHidden(bool hidden); |
64 | 64 |
65 // Called when the app shim process notifies that the app should quit. | 65 // Called when the app shim process notifies that the app should quit. |
66 void OnQuit(); | 66 void OnQuit(); |
67 | 67 |
68 // apps::AppShimHandler::Host overrides: | 68 // apps::AppShimHandler::Host overrides: |
69 virtual void OnAppLaunchComplete(apps::AppShimLaunchResult result) OVERRIDE; | 69 virtual void OnAppLaunchComplete(apps::AppShimLaunchResult result) override; |
70 virtual void OnAppClosed() OVERRIDE; | 70 virtual void OnAppClosed() override; |
71 virtual void OnAppHide() OVERRIDE; | 71 virtual void OnAppHide() override; |
72 virtual void OnAppRequestUserAttention( | 72 virtual void OnAppRequestUserAttention( |
73 apps::AppShimAttentionType type) OVERRIDE; | 73 apps::AppShimAttentionType type) override; |
74 virtual base::FilePath GetProfilePath() const OVERRIDE; | 74 virtual base::FilePath GetProfilePath() const override; |
75 virtual std::string GetAppId() const OVERRIDE; | 75 virtual std::string GetAppId() const override; |
76 | 76 |
77 // Closes the channel and destroys the AppShimHost. | 77 // Closes the channel and destroys the AppShimHost. |
78 void Close(); | 78 void Close(); |
79 | 79 |
80 scoped_ptr<IPC::ChannelProxy> channel_; | 80 scoped_ptr<IPC::ChannelProxy> channel_; |
81 std::string app_id_; | 81 std::string app_id_; |
82 base::FilePath profile_path_; | 82 base::FilePath profile_path_; |
83 bool initial_launch_finished_; | 83 bool initial_launch_finished_; |
84 }; | 84 }; |
85 | 85 |
86 #endif // CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MAC_H_ | 86 #endif // CHROME_BROWSER_APPS_APP_SHIM_APP_SHIM_HOST_MAC_H_ |
OLD | NEW |