OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/win/elevated_controller.h" | 5 #include "remoting/host/win/elevated_controller.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 if (version_out == NULL) { | 347 if (version_out == NULL) { |
348 return E_OUTOFMEMORY; | 348 return E_OUTOFMEMORY; |
349 } | 349 } |
350 | 350 |
351 return S_OK; | 351 return S_OK; |
352 } | 352 } |
353 | 353 |
354 STDMETHODIMP ElevatedController::SetConfig(BSTR config) { | 354 STDMETHODIMP ElevatedController::SetConfig(BSTR config) { |
355 // Determine the config directory path and create it if necessary. | 355 // Determine the config directory path and create it if necessary. |
356 base::FilePath config_dir = remoting::GetConfigDir(); | 356 base::FilePath config_dir = remoting::GetConfigDir(); |
357 if (!file_util::CreateDirectory(config_dir)) { | 357 if (!base::CreateDirectory(config_dir)) { |
358 return HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED); | 358 return HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED); |
359 } | 359 } |
360 | 360 |
361 std::string file_content = UTF16ToUTF8( | 361 std::string file_content = UTF16ToUTF8( |
362 string16(static_cast<char16*>(config), ::SysStringLen(config))); | 362 string16(static_cast<char16*>(config), ::SysStringLen(config))); |
363 | 363 |
364 return WriteConfig(file_content.c_str(), file_content.size(), owner_window_); | 364 return WriteConfig(file_content.c_str(), file_content.size(), owner_window_); |
365 } | 365 } |
366 | 366 |
367 STDMETHODIMP ElevatedController::SetOwnerWindow(LONG_PTR window_handle) { | 367 STDMETHODIMP ElevatedController::SetOwnerWindow(LONG_PTR window_handle) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 << "Failed to open to the '" << kWindowsServiceName << "' service"; | 528 << "Failed to open to the '" << kWindowsServiceName << "' service"; |
529 | 529 |
530 return HRESULT_FROM_WIN32(error); | 530 return HRESULT_FROM_WIN32(error); |
531 } | 531 } |
532 | 532 |
533 service_out->Set(service.Take()); | 533 service_out->Set(service.Take()); |
534 return S_OK; | 534 return S_OK; |
535 } | 535 } |
536 | 536 |
537 } // namespace remoting | 537 } // namespace remoting |
OLD | NEW |