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