| 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/plugin/daemon_controller.h" | 5 #include "remoting/host/plugin/daemon_controller.h" |
| 6 | 6 |
| 7 #include <launch.h> | 7 #include <launch.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 virtual ~DaemonControllerMac(); | 57 virtual ~DaemonControllerMac(); |
| 58 | 58 |
| 59 virtual State GetState() OVERRIDE; | 59 virtual State GetState() OVERRIDE; |
| 60 virtual void GetConfig(const GetConfigCallback& callback) OVERRIDE; | 60 virtual void GetConfig(const GetConfigCallback& callback) OVERRIDE; |
| 61 virtual void SetConfigAndStart( | 61 virtual void SetConfigAndStart( |
| 62 scoped_ptr<base::DictionaryValue> config, | 62 scoped_ptr<base::DictionaryValue> config, |
| 63 const CompletionCallback& done_callback) OVERRIDE; | 63 const CompletionCallback& done_callback) OVERRIDE; |
| 64 virtual void UpdateConfig(scoped_ptr<base::DictionaryValue> config, | 64 virtual void UpdateConfig(scoped_ptr<base::DictionaryValue> config, |
| 65 const CompletionCallback& done_callback) OVERRIDE; | 65 const CompletionCallback& done_callback) OVERRIDE; |
| 66 virtual void Stop(const CompletionCallback& done_callback) OVERRIDE; | 66 virtual void Stop(const CompletionCallback& done_callback) OVERRIDE; |
| 67 virtual void SetWindow(void* window_handle) OVERRIDE; |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 void DoGetConfig(const GetConfigCallback& callback); | 70 void DoGetConfig(const GetConfigCallback& callback); |
| 70 void DoSetConfigAndStart(scoped_ptr<base::DictionaryValue> config, | 71 void DoSetConfigAndStart(scoped_ptr<base::DictionaryValue> config, |
| 71 const CompletionCallback& done_callback); | 72 const CompletionCallback& done_callback); |
| 72 void DoUpdateConfig(scoped_ptr<base::DictionaryValue> config, | 73 void DoUpdateConfig(scoped_ptr<base::DictionaryValue> config, |
| 73 const CompletionCallback& done_callback); | 74 const CompletionCallback& done_callback); |
| 74 void DoStop(const CompletionCallback& done_callback); | 75 void DoStop(const CompletionCallback& done_callback); |
| 75 void NotifyWhenStopped(const CompletionCallback& done_callback, | 76 void NotifyWhenStopped(const CompletionCallback& done_callback, |
| 76 int tries_remaining, | 77 int tries_remaining, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 &DaemonControllerMac::DoUpdateConfig, base::Unretained(this), | 140 &DaemonControllerMac::DoUpdateConfig, base::Unretained(this), |
| 140 base::Passed(&config), done_callback)); | 141 base::Passed(&config), done_callback)); |
| 141 } | 142 } |
| 142 | 143 |
| 143 void DaemonControllerMac::Stop(const CompletionCallback& done_callback) { | 144 void DaemonControllerMac::Stop(const CompletionCallback& done_callback) { |
| 144 auth_thread_.message_loop_proxy()->PostTask( | 145 auth_thread_.message_loop_proxy()->PostTask( |
| 145 FROM_HERE, base::Bind( | 146 FROM_HERE, base::Bind( |
| 146 &DaemonControllerMac::DoStop, base::Unretained(this), done_callback)); | 147 &DaemonControllerMac::DoStop, base::Unretained(this), done_callback)); |
| 147 } | 148 } |
| 148 | 149 |
| 150 void DaemonControllerMac::SetWindow(void* window_handle) { |
| 151 // noop |
| 152 } |
| 153 |
| 149 void DaemonControllerMac::DoGetConfig(const GetConfigCallback& callback) { | 154 void DaemonControllerMac::DoGetConfig(const GetConfigCallback& callback) { |
| 150 FilePath config_path(kHostConfigFile); | 155 FilePath config_path(kHostConfigFile); |
| 151 JsonHostConfig host_config(config_path); | 156 JsonHostConfig host_config(config_path); |
| 152 scoped_ptr<base::DictionaryValue> config; | 157 scoped_ptr<base::DictionaryValue> config; |
| 153 | 158 |
| 154 if (host_config.Read()) { | 159 if (host_config.Read()) { |
| 155 config.reset(new base::DictionaryValue()); | 160 config.reset(new base::DictionaryValue()); |
| 156 std::string value; | 161 std::string value; |
| 157 if (host_config.GetString(kHostIdConfigPath, &value)) | 162 if (host_config.GetString(kHostIdConfigPath, &value)) |
| 158 config.get()->SetString(kHostIdConfigPath, value); | 163 config.get()->SetString(kHostIdConfigPath, value); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 return true; | 335 return true; |
| 331 } | 336 } |
| 332 | 337 |
| 333 } // namespace | 338 } // namespace |
| 334 | 339 |
| 335 scoped_ptr<DaemonController> remoting::DaemonController::Create() { | 340 scoped_ptr<DaemonController> remoting::DaemonController::Create() { |
| 336 return scoped_ptr<DaemonController>(new DaemonControllerMac()); | 341 return scoped_ptr<DaemonController>(new DaemonControllerMac()); |
| 337 } | 342 } |
| 338 | 343 |
| 339 } // namespace remoting | 344 } // namespace remoting |
| OLD | NEW |