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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 bool DaemonControllerDelegateMac::DoShowPreferencePane( | 223 bool DaemonControllerDelegateMac::DoShowPreferencePane( |
224 const std::string& config_data) { | 224 const std::string& config_data) { |
225 if (!config_data.empty()) { | 225 if (!config_data.empty()) { |
226 base::FilePath config_path; | 226 base::FilePath config_path; |
227 if (!base::GetTempDir(&config_path)) { | 227 if (!base::GetTempDir(&config_path)) { |
228 LOG(ERROR) << "Failed to get filename for saving configuration data."; | 228 LOG(ERROR) << "Failed to get filename for saving configuration data."; |
229 return false; | 229 return false; |
230 } | 230 } |
231 config_path = config_path.Append(kHostConfigFileName); | 231 config_path = config_path.Append(kHostConfigFileName); |
232 | 232 |
233 int written = file_util::WriteFile(config_path, config_data.data(), | 233 int written = base::WriteFile(config_path, config_data.data(), |
234 config_data.size()); | 234 config_data.size()); |
235 if (written != static_cast<int>(config_data.size())) { | 235 if (written != static_cast<int>(config_data.size())) { |
236 LOG(ERROR) << "Failed to save configuration data to: " | 236 LOG(ERROR) << "Failed to save configuration data to: " |
237 << config_path.value(); | 237 << config_path.value(); |
238 return false; | 238 return false; |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 base::FilePath pane_path; | 242 base::FilePath pane_path; |
243 // TODO(lambroslambrou): Use NSPreferencePanesDirectory once we start | 243 // TODO(lambroslambrou): Use NSPreferencePanesDirectory once we start |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 self->PreferencePaneCallbackDelegate(name); | 286 self->PreferencePaneCallbackDelegate(name); |
287 } | 287 } |
288 | 288 |
289 scoped_refptr<DaemonController> DaemonController::Create() { | 289 scoped_refptr<DaemonController> DaemonController::Create() { |
290 scoped_ptr<DaemonController::Delegate> delegate( | 290 scoped_ptr<DaemonController::Delegate> delegate( |
291 new DaemonControllerDelegateMac()); | 291 new DaemonControllerDelegateMac()); |
292 return new DaemonController(delegate.Pass()); | 292 return new DaemonController(delegate.Pass()); |
293 } | 293 } |
294 | 294 |
295 } // namespace remoting | 295 } // namespace remoting |
OLD | NEW |