| 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 "chrome/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 service_prefs_->ReadPrefs(); | 168 service_prefs_->ReadPrefs(); |
| 169 | 169 |
| 170 // Check if a locale override has been specified on the command-line. | 170 // Check if a locale override has been specified on the command-line. |
| 171 std::string locale = command_line.GetSwitchValueASCII(switches::kLang); | 171 std::string locale = command_line.GetSwitchValueASCII(switches::kLang); |
| 172 if (!locale.empty()) { | 172 if (!locale.empty()) { |
| 173 service_prefs_->SetString(prefs::kApplicationLocale, locale); | 173 service_prefs_->SetString(prefs::kApplicationLocale, locale); |
| 174 service_prefs_->WritePrefs(); | 174 service_prefs_->WritePrefs(); |
| 175 } else { | 175 } else { |
| 176 // If no command-line value was specified, read the last used locale from | 176 // If no command-line value was specified, read the last used locale from |
| 177 // the prefs. | 177 // the prefs. |
| 178 locale = service_prefs_->GetString(prefs::kApplicationLocale, ""); | 178 locale = |
| 179 service_prefs_->GetString(prefs::kApplicationLocale, std::string()); |
| 179 // If no locale was specified anywhere, use the default one. | 180 // If no locale was specified anywhere, use the default one. |
| 180 if (locale.empty()) | 181 if (locale.empty()) |
| 181 locale = kDefaultServiceProcessLocale; | 182 locale = kDefaultServiceProcessLocale; |
| 182 } | 183 } |
| 183 ResourceBundle::InitSharedInstanceWithLocale(locale, NULL); | 184 ResourceBundle::InitSharedInstanceWithLocale(locale, NULL); |
| 184 | 185 |
| 185 PrepareRestartOnCrashEnviroment(command_line); | 186 PrepareRestartOnCrashEnviroment(command_line); |
| 186 | 187 |
| 187 // Enable Cloud Print if needed. First check the command-line. | 188 // Enable Cloud Print if needed. First check the command-line. |
| 188 // Then check if the cloud print proxy was previously enabled. | 189 // Then check if the cloud print proxy was previously enabled. |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 if (enabled_services_ && !ipc_server_->is_client_connected()) { | 367 if (enabled_services_ && !ipc_server_->is_client_connected()) { |
| 367 GetCloudPrintProxy()->CheckCloudPrintProxyPolicy(); | 368 GetCloudPrintProxy()->CheckCloudPrintProxyPolicy(); |
| 368 } | 369 } |
| 369 ScheduleCloudPrintPolicyCheck(); | 370 ScheduleCloudPrintPolicyCheck(); |
| 370 } | 371 } |
| 371 | 372 |
| 372 ServiceProcess::~ServiceProcess() { | 373 ServiceProcess::~ServiceProcess() { |
| 373 Teardown(); | 374 Teardown(); |
| 374 g_service_process = NULL; | 375 g_service_process = NULL; |
| 375 } | 376 } |
| OLD | NEW |