| 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 #include <CoreFoundation/CoreFoundation.h> | 5 #include <CoreFoundation/CoreFoundation.h> |
| 6 | 6 |
| 7 #include "remoting/host/setup/daemon_controller_delegate_mac.h" | 7 #include "remoting/host/setup/daemon_controller_delegate_mac.h" |
| 8 | 8 |
| 9 #include <launch.h> | 9 #include <launch.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 HostConfigFromJsonFile(config_path)); | 54 HostConfigFromJsonFile(config_path)); |
| 55 if (!host_config) | 55 if (!host_config) |
| 56 return nullptr; | 56 return nullptr; |
| 57 | 57 |
| 58 scoped_ptr<base::DictionaryValue> config(new base::DictionaryValue); | 58 scoped_ptr<base::DictionaryValue> config(new base::DictionaryValue); |
| 59 std::string value; | 59 std::string value; |
| 60 if (host_config->GetString(kHostIdConfigPath, &value)) | 60 if (host_config->GetString(kHostIdConfigPath, &value)) |
| 61 config->SetString(kHostIdConfigPath, value); | 61 config->SetString(kHostIdConfigPath, value); |
| 62 if (host_config->GetString(kXmppLoginConfigPath, &value)) | 62 if (host_config->GetString(kXmppLoginConfigPath, &value)) |
| 63 config->SetString(kXmppLoginConfigPath, value); | 63 config->SetString(kXmppLoginConfigPath, value); |
| 64 return config.Pass(); | 64 return config; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void DaemonControllerDelegateMac::SetConfigAndStart( | 67 void DaemonControllerDelegateMac::SetConfigAndStart( |
| 68 scoped_ptr<base::DictionaryValue> config, | 68 scoped_ptr<base::DictionaryValue> config, |
| 69 bool consent, | 69 bool consent, |
| 70 const DaemonController::CompletionCallback& done) { | 70 const DaemonController::CompletionCallback& done) { |
| 71 config->SetBoolean(kUsageStatsConsentConfigPath, consent); | 71 config->SetBoolean(kUsageStatsConsentConfigPath, consent); |
| 72 ShowPreferencePane(HostConfigToJson(*config), done); | 72 ShowPreferencePane(HostConfigToJson(*config), done); |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 reinterpret_cast<DaemonControllerDelegateMac*>(observer); | 242 reinterpret_cast<DaemonControllerDelegateMac*>(observer); |
| 243 if (!self) { | 243 if (!self) { |
| 244 LOG(WARNING) << "Ignoring notification with nullptr observer: " << name; | 244 LOG(WARNING) << "Ignoring notification with nullptr observer: " << name; |
| 245 return; | 245 return; |
| 246 } | 246 } |
| 247 | 247 |
| 248 self->PreferencePaneCallbackDelegate(name); | 248 self->PreferencePaneCallbackDelegate(name); |
| 249 } | 249 } |
| 250 | 250 |
| 251 scoped_refptr<DaemonController> DaemonController::Create() { | 251 scoped_refptr<DaemonController> DaemonController::Create() { |
| 252 scoped_ptr<DaemonController::Delegate> delegate( | 252 return new DaemonController( |
| 253 new DaemonControllerDelegateMac()); | 253 make_scoped_ptr(new DaemonControllerDelegateMac())); |
| 254 return new DaemonController(delegate.Pass()); | |
| 255 } | 254 } |
| 256 | 255 |
| 257 } // namespace remoting | 256 } // namespace remoting |
| OLD | NEW |