OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 REMOTING_HOST_DAEMON_CONTROLLER_H_ | 5 #ifndef REMOTING_HOST_DAEMON_CONTROLLER_H_ |
6 #define REMOTING_HOST_DAEMON_CONTROLLER_H_ | 6 #define REMOTING_HOST_DAEMON_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // TODO(sergeyu): Current implementations don't return this value. | 58 // TODO(sergeyu): Current implementations don't return this value. |
59 RESULT_CANCELLED = 2, | 59 RESULT_CANCELLED = 2, |
60 | 60 |
61 // Failed to access host directory. | 61 // Failed to access host directory. |
62 RESULT_FAILED_DIRECTORY = 3 | 62 RESULT_FAILED_DIRECTORY = 3 |
63 | 63 |
64 // TODO(sergeyu): Add more error codes when we know how to handle | 64 // TODO(sergeyu): Add more error codes when we know how to handle |
65 // them in the webapp. | 65 // them in the webapp. |
66 }; | 66 }; |
67 | 67 |
68 // The callback for GetConfig(). |config| is set to NULL in case of | 68 // Callback type for GetConfig(). If the host is configured then a dictionary |
69 // an error. Otherwise it is a dictionary that contains only the | 69 // is returned containing host_id and xmpp_login, with security-sensitive |
70 // following values: host_id and xmpp_login, which may be empty if | 70 // fields filtered out. An empty dictionary is returned if the host is not |
71 // the host is not initialized yet. All other values are filtered out of the | 71 // configured, and NULL if the configuration is corrupt or cannot be read. |
72 // config before this callback is invoked: they may contain security | |
73 // sensitive information, such as authentication tokens and private keys. | |
74 typedef base::Callback<void (scoped_ptr<base::DictionaryValue> config)> | 72 typedef base::Callback<void (scoped_ptr<base::DictionaryValue> config)> |
75 GetConfigCallback; | 73 GetConfigCallback; |
76 | 74 |
77 // Callback used for asynchronous operations, e.g. when | 75 // Callback used for asynchronous operations, e.g. when |
78 // starting/stopping the service. | 76 // starting/stopping the service. |
79 typedef base::Callback<void (AsyncResult result)> CompletionCallback; | 77 typedef base::Callback<void (AsyncResult result)> CompletionCallback; |
80 | 78 |
81 virtual ~DaemonController() {} | 79 virtual ~DaemonController() {} |
82 | 80 |
83 // Return the "installed/running" state of the daemon process. | 81 // Return the "installed/running" state of the daemon process. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Caches the native handle of the plugin window so it can be used to focus | 121 // Caches the native handle of the plugin window so it can be used to focus |
124 // elevation prompts properly. | 122 // elevation prompts properly. |
125 virtual void SetWindow(void* window_handle) = 0; | 123 virtual void SetWindow(void* window_handle) = 0; |
126 | 124 |
127 static scoped_ptr<DaemonController> Create(); | 125 static scoped_ptr<DaemonController> Create(); |
128 }; | 126 }; |
129 | 127 |
130 } // namespace remoting | 128 } // namespace remoting |
131 | 129 |
132 #endif // REMOTING_HOST_DAEMON_CONTROLLER_H_ | 130 #endif // REMOTING_HOST_DAEMON_CONTROLLER_H_ |
OLD | NEW |