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