| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "chrome/common/chrome_paths.h" | 7 #include "chrome/common/chrome_paths.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/common/main_function_params.h" | 9 #include "chrome/common/main_function_params.h" |
| 10 #include "chrome/common/sandbox_policy.h" | 10 #include "chrome/common/sandbox_policy.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // TODO(hclam): Merge this config file with Cloud Printing. | 55 // TODO(hclam): Merge this config file with Cloud Printing. |
| 56 // TODO(hclam): There is only start but not stop of the chromoting host | 56 // TODO(hclam): There is only start but not stop of the chromoting host |
| 57 // process. | 57 // process. |
| 58 FilePath user_data_dir; | 58 FilePath user_data_dir; |
| 59 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 59 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
| 60 FilePath chromoting_config_path = | 60 FilePath chromoting_config_path = |
| 61 user_data_dir.Append(FILE_PATH_LITERAL(".ChromotingConfig.json")); | 61 user_data_dir.Append(FILE_PATH_LITERAL(".ChromotingConfig.json")); |
| 62 scoped_refptr<remoting::JsonHostConfig> chromoting_config; | 62 scoped_refptr<remoting::JsonHostConfig> chromoting_config; |
| 63 scoped_ptr<remoting::ChromotingHostContext> chromoting_context; | 63 scoped_ptr<remoting::ChromotingHostContext> chromoting_context; |
| 64 scoped_refptr<remoting::ChromotingHost> chromoting_host; | 64 scoped_refptr<remoting::ChromotingHost> chromoting_host; |
| 65 if (parameters.command_line_.HasSwitch(switches::kEnableChromoting)) { | 65 if (parameters.command_line_.HasSwitch(switches::kEnableRemoting)) { |
| 66 chromoting_config = new remoting::JsonHostConfig( | 66 chromoting_config = new remoting::JsonHostConfig( |
| 67 chromoting_config_path, | 67 chromoting_config_path, |
| 68 service_process.file_thread()->message_loop_proxy()); | 68 service_process.file_thread()->message_loop_proxy()); |
| 69 if (!chromoting_config->Read()) { | 69 if (!chromoting_config->Read()) { |
| 70 LOG(ERROR) << "Failed to read chromoting config file."; | 70 LOG(ERROR) << "Failed to read chromoting config file."; |
| 71 } else { | 71 } else { |
| 72 chromoting_context.reset(new remoting::ChromotingHostContext()); | 72 chromoting_context.reset(new remoting::ChromotingHostContext()); |
| 73 | 73 |
| 74 // Create the Chromoting Host Process with the context and config. | 74 // Create the Chromoting Host Process with the context and config. |
| 75 chromoting_host = service_process.CreateChromotingHost( | 75 chromoting_host = service_process.CreateChromotingHost( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 87 &main_message_loop, chromoting_context.get())); | 87 &main_message_loop, chromoting_context.get())); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 #endif | 90 #endif |
| 91 | 91 |
| 92 MessageLoop::current()->Run(); | 92 MessageLoop::current()->Run(); |
| 93 service_process.Teardown(); | 93 service_process.Teardown(); |
| 94 | 94 |
| 95 return 0; | 95 return 0; |
| 96 } | 96 } |
| 97 | |
| OLD | NEW |