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 REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_MAC_H_ | 5 #ifndef REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_MAC_H_ |
6 #define REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_MAC_H_ | 6 #define REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_MAC_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "remoting/host/setup/daemon_controller.h" | 10 #include "remoting/host/setup/daemon_controller.h" |
11 | 11 |
12 namespace remoting { | 12 namespace remoting { |
13 | 13 |
14 class DaemonControllerDelegateMac : public DaemonController::Delegate { | 14 class DaemonControllerDelegateMac : public DaemonController::Delegate { |
15 public: | 15 public: |
16 DaemonControllerDelegateMac(); | 16 DaemonControllerDelegateMac(); |
17 ~DaemonControllerDelegateMac() override; | 17 ~DaemonControllerDelegateMac() override; |
18 | 18 |
19 // DaemonController::Delegate interface. | 19 // DaemonController::Delegate interface. |
20 DaemonController::State GetState() override; | 20 DaemonController::State GetState() override; |
21 scoped_ptr<base::DictionaryValue> GetConfig() override; | 21 scoped_ptr<base::DictionaryValue> GetConfig() override; |
22 void SetConfigAndStart( | 22 void SetConfigAndStart( |
23 scoped_ptr<base::DictionaryValue> config, | 23 scoped_ptr<base::DictionaryValue> config, |
24 bool consent, | 24 bool consent, |
25 const DaemonController::CompletionCallback& done) override; | 25 const base::Closure& on_done, |
| 26 const DaemonController::ErrorCallback& on_error) override; |
26 void UpdateConfig(scoped_ptr<base::DictionaryValue> config, | 27 void UpdateConfig(scoped_ptr<base::DictionaryValue> config, |
27 const DaemonController::CompletionCallback& done) override; | 28 const base::Closure& on_done, |
28 void Stop(const DaemonController::CompletionCallback& done) override; | 29 const DaemonController::ErrorCallback& on_error) override; |
| 30 void Stop(const base::Closure& on_done, |
| 31 const DaemonController::ErrorCallback& on_error) override; |
29 DaemonController::UsageStatsConsent GetUsageStatsConsent() override; | 32 DaemonController::UsageStatsConsent GetUsageStatsConsent() override; |
30 | 33 |
31 private: | 34 private: |
32 void ShowPreferencePane(const std::string& config_data, | 35 void ShowPreferencePane(const std::string& config_data, |
33 const DaemonController::CompletionCallback& done); | 36 const base::Closure& on_done, |
| 37 const DaemonController::ErrorCallback& on_error); |
34 void RegisterForPreferencePaneNotifications( | 38 void RegisterForPreferencePaneNotifications( |
35 const DaemonController::CompletionCallback &done); | 39 const base::Closure& on_done, |
| 40 const DaemonController::ErrorCallback& on_error); |
36 void DeregisterForPreferencePaneNotifications(); | 41 void DeregisterForPreferencePaneNotifications(); |
37 void PreferencePaneCallbackDelegate(CFStringRef name); | 42 void PreferencePaneCallbackDelegate(CFStringRef name); |
38 | 43 |
39 static bool DoShowPreferencePane(const std::string& config_data); | 44 static bool DoShowPreferencePane( |
| 45 const std::string& config_data, |
| 46 const DaemonController::ErrorCallback& on_error); |
40 static void PreferencePaneCallback(CFNotificationCenterRef center, | 47 static void PreferencePaneCallback(CFNotificationCenterRef center, |
41 void* observer, | 48 void* observer, |
42 CFStringRef name, | 49 CFStringRef name, |
43 const void* object, | 50 const void* object, |
44 CFDictionaryRef user_info); | 51 CFDictionaryRef user_info); |
45 | 52 |
46 DaemonController::CompletionCallback current_callback_; | 53 base::Closure on_done_; |
| 54 DaemonController::ErrorCallback on_error_; |
47 | 55 |
48 DISALLOW_COPY_AND_ASSIGN(DaemonControllerDelegateMac); | 56 DISALLOW_COPY_AND_ASSIGN(DaemonControllerDelegateMac); |
49 }; | 57 }; |
50 | 58 |
51 } // namespace remoting | 59 } // namespace remoting |
52 | 60 |
53 #endif // REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_MAC_H_ | 61 #endif // REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_MAC_H_ |
OLD | NEW |