diff options
Diffstat (limited to 'chrome/service/service_main.cc')
-rw-r--r-- | chrome/service/service_main.cc | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc index 2f09489..e44521e 100644 --- a/chrome/service/service_main.cc +++ b/chrome/service/service_main.cc @@ -4,10 +4,8 @@ #include "base/message_loop.h" #include "base/path_service.h" -#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/json_pref_store.h" #include "chrome/common/main_function_params.h" #include "chrome/common/sandbox_policy.h" #include "chrome/service/cloud_print/cloud_print_proxy.h" @@ -44,29 +42,12 @@ int ServiceProcessMain(const MainFunctionParams& parameters) { ServiceProcess service_process; service_process.Initialize(); - // TODO(sanjeevr): The interface to start individual services such as the - // cloud print proxy needs to change from a command-line interface to an - // IPC interface. There will be eventually only one service process to handle - // requests from multiple Chrome browser profiles. The path of the user data - // directory will be passed in to the command and there will be one instance - // of services such as the cloud print proxy per requesting profile. - FilePath user_data_dir; - PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); - FilePath pref_path = user_data_dir.Append(chrome::kServiceStateFileName); - scoped_ptr<JsonPrefStore> service_prefs( - new JsonPrefStore( - pref_path, - service_process.file_thread()->message_loop_proxy())); - service_prefs->ReadPrefs(); - // Enable Cloud Print if needed. if (parameters.command_line_.HasSwitch(switches::kEnableCloudPrintProxy)) { std::string lsid = parameters.command_line_.GetSwitchValueASCII( switches::kServiceAccountLsid); - CloudPrintProxy* cloud_print_proxy = - service_process.CreateCloudPrintProxy(service_prefs.get()); - cloud_print_proxy->EnableForUser(lsid); + service_process.GetCloudPrintProxy()->EnableForUser(lsid); } #if defined(ENABLE_REMOTING) @@ -74,6 +55,8 @@ int ServiceProcessMain(const MainFunctionParams& parameters) { // TODO(hclam): Merge this config file with Cloud Printing. // TODO(hclam): There is only start but not stop of the chromoting host // process. + FilePath user_data_dir; + PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); FilePath chromoting_config_path = user_data_dir.Append(FILE_PATH_LITERAL(".ChromotingConfig.json")); scoped_refptr<remoting::JsonHostConfig> chromoting_config; @@ -107,7 +90,6 @@ int ServiceProcessMain(const MainFunctionParams& parameters) { #endif MessageLoop::current()->Run(); - service_prefs->WritePrefs(); service_process.Teardown(); return 0; |