| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/desktop_environment_options.h" | 5 #include "remoting/host/desktop_environment_options.h" |
| 6 | 6 |
| 7 #include <string> |
| 7 #include <utility> | 8 #include <utility> |
| 8 | 9 |
| 10 #include "base/optional.h" |
| 11 |
| 9 namespace remoting { | 12 namespace remoting { |
| 10 | 13 |
| 11 using DesktopCaptureOptions = webrtc::DesktopCaptureOptions; | 14 using DesktopCaptureOptions = webrtc::DesktopCaptureOptions; |
| 12 | 15 |
| 13 // static | 16 // static |
| 14 DesktopEnvironmentOptions DesktopEnvironmentOptions::CreateDefault() { | 17 DesktopEnvironmentOptions DesktopEnvironmentOptions::CreateDefault() { |
| 15 DesktopEnvironmentOptions options; | 18 DesktopEnvironmentOptions options; |
| 16 options.desktop_capture_options_ = DesktopCaptureOptions::CreateDefault(); | 19 options.desktop_capture_options_ = DesktopCaptureOptions::CreateDefault(); |
| 17 options.Initialize(); | 20 options.Initialize(); |
| 18 return options; | 21 return options; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 64 } |
| 62 | 65 |
| 63 bool DesktopEnvironmentOptions::enable_user_interface() const { | 66 bool DesktopEnvironmentOptions::enable_user_interface() const { |
| 64 return enable_user_interface_; | 67 return enable_user_interface_; |
| 65 } | 68 } |
| 66 | 69 |
| 67 void DesktopEnvironmentOptions::set_enable_user_interface(bool enabled) { | 70 void DesktopEnvironmentOptions::set_enable_user_interface(bool enabled) { |
| 68 enable_user_interface_ = enabled; | 71 enable_user_interface_ = enabled; |
| 69 } | 72 } |
| 70 | 73 |
| 74 void DesktopEnvironmentOptions::ApplyHostSessionOptions( |
| 75 const HostSessionOptions& options) { |
| 76 #if defined(OS_WIN) |
| 77 base::Optional<std::string> directx_capturer = |
| 78 options.Get("DirectX-Capturer"); |
| 79 if (directx_capturer) { |
| 80 desktop_capture_options_.set_allow_directx_capturer( |
| 81 *directx_capturer == "true"); |
| 82 } |
| 83 #endif |
| 84 // This field is for test purpose. Usually it should not be set to false. |
| 85 base::Optional<std::string> detect_updated_region = |
| 86 options.Get("Detect-Updated-Region"); |
| 87 if (detect_updated_region) { |
| 88 desktop_capture_options_.set_detect_updated_region( |
| 89 *detect_updated_region == "true"); |
| 90 } |
| 91 } |
| 92 |
| 71 } // namespace remoting | 93 } // namespace remoting |
| OLD | NEW |