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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 typedef base::Callback<void (scoped_ptr<base::DictionaryValue> config)> | 72 typedef base::Callback<void (scoped_ptr<base::DictionaryValue> config)> |
73 GetConfigCallback; | 73 GetConfigCallback; |
74 | 74 |
75 // Callback used for asynchronous operations, e.g. when | 75 // Callback used for asynchronous operations, e.g. when |
76 // starting/stopping the service. | 76 // starting/stopping the service. |
77 typedef base::Callback<void (AsyncResult result)> CompletionCallback; | 77 typedef base::Callback<void (AsyncResult result)> CompletionCallback; |
78 | 78 |
79 // Callback type for GetVersion(). | 79 // Callback type for GetVersion(). |
80 typedef base::Callback<void (const std::string&)> GetVersionCallback; | 80 typedef base::Callback<void (const std::string&)> GetVersionCallback; |
81 | 81 |
82 // Callback type for GetUsageStatsConsent(). | |
83 typedef base::Callback<void (bool, bool)> GetUsageStatsConsentCallback; | |
84 | |
82 virtual ~DaemonController() {} | 85 virtual ~DaemonController() {} |
83 | 86 |
84 // Return the "installed/running" state of the daemon process. | 87 // Return the "installed/running" state of the daemon process. |
85 // | 88 // |
86 // TODO(sergeyu): This method is called synchronously from the | 89 // TODO(sergeyu): This method is called synchronously from the |
87 // webapp. In most cases it requires IO operations, so it may block | 90 // webapp. In most cases it requires IO operations, so it may block |
88 // the user interface. Replace it with asynchronous notifications, | 91 // the user interface. Replace it with asynchronous notifications, |
89 // e.g. with StartStateNotifications()/StopStateNotifications() methods. | 92 // e.g. with StartStateNotifications()/StopStateNotifications() methods. |
90 virtual State GetState() = 0; | 93 virtual State GetState() = 0; |
91 | 94 |
(...skipping 30 matching lines...) Expand all Loading... | |
122 virtual void Stop(const CompletionCallback& done_callback) = 0; | 125 virtual void Stop(const CompletionCallback& done_callback) = 0; |
123 | 126 |
124 // Caches the native handle of the plugin window so it can be used to focus | 127 // Caches the native handle of the plugin window so it can be used to focus |
125 // elevation prompts properly. | 128 // elevation prompts properly. |
126 virtual void SetWindow(void* window_handle) = 0; | 129 virtual void SetWindow(void* window_handle) = 0; |
127 | 130 |
128 // Get the version of the daemon as a dotted decimal string of the form | 131 // Get the version of the daemon as a dotted decimal string of the form |
129 // major.minor.build.patch, if it is installed, or "" otherwise. | 132 // major.minor.build.patch, if it is installed, or "" otherwise. |
130 virtual void GetVersion(const GetVersionCallback& done_callback) = 0; | 133 virtual void GetVersion(const GetVersionCallback& done_callback) = 0; |
131 | 134 |
135 // Get the user's consent to crash reporting. | |
136 virtual void GetUsageStatsConsent( | |
137 const GetUsageStatsConsentCallback& callback) = 0; | |
Jamie
2012/06/14 23:43:56
There's no provision here for returning "unsupport
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
138 | |
139 // Set the user's consent to crash reporting. | |
140 virtual void SetUsageStatsConsent(bool consent) = 0; | |
141 | |
132 static scoped_ptr<DaemonController> Create(); | 142 static scoped_ptr<DaemonController> Create(); |
133 }; | 143 }; |
134 | 144 |
135 } // namespace remoting | 145 } // namespace remoting |
136 | 146 |
137 #endif // REMOTING_HOST_DAEMON_CONTROLLER_H_ | 147 #endif // REMOTING_HOST_DAEMON_CONTROLLER_H_ |
OLD | NEW |