Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10932)

Unified Diff: chrome/service/service_process.cc

Issue 6245005: Code to send diagnostic messages about cloud print proxy. Currently diagnosti... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixed build errors yet again Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/service/service_process.cc
===================================================================
--- chrome/service/service_process.cc (revision 70946)
+++ chrome/service/service_process.cc (working copy)
@@ -6,6 +6,8 @@
#include <algorithm>
+#include "app/app_switches.h"
+#include "app/resource_bundle.h"
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/path_service.h"
@@ -36,6 +38,8 @@
// a shutdown.
const int64 kShutdownDelay = 60000;
+const char kDefaultServiceProcessLocale[] = "en-US";
+
class ServiceIOThread : public base::Thread {
public:
explicit ServiceIOThread(const char* name);
@@ -97,6 +101,21 @@
new ServiceProcessPrefs(pref_path, file_thread_->message_loop_proxy()));
service_prefs_->ReadPrefs();
+ // Check if a locale override has been specified on the command-line.
+ std::string locale = command_line.GetSwitchValueASCII(switches::kLang);
+ if (!locale.empty()) {
+ service_prefs_->SetString(prefs::kApplicationLocale, locale);
+ service_prefs_->WritePrefs();
+ } else {
+ // If no command-line value was specified, read the last used locale from
+ // the prefs.
+ service_prefs_->GetString(prefs::kApplicationLocale, &locale);
+ // If no locale was specified anywhere, use the default one.
+ if (locale.empty())
+ locale = kDefaultServiceProcessLocale;
+ }
+ ResourceBundle::InitSharedInstance(locale);
+
#if defined(ENABLE_REMOTING)
// Initialize chromoting host manager.
remoting_host_manager_ = new remoting::ChromotingHostManager(this);
@@ -176,17 +195,21 @@
return cloud_print_proxy_.get();
}
-void ServiceProcess::OnCloudPrintProxyEnabled() {
- // Save the preference that we have enabled the cloud print proxy.
- service_prefs_->SetBoolean(prefs::kCloudPrintProxyEnabled, true);
- service_prefs_->WritePrefs();
+void ServiceProcess::OnCloudPrintProxyEnabled(bool persist_state) {
+ if (persist_state) {
+ // Save the preference that we have enabled the cloud print proxy.
+ service_prefs_->SetBoolean(prefs::kCloudPrintProxyEnabled, true);
+ service_prefs_->WritePrefs();
+ }
OnServiceEnabled();
}
-void ServiceProcess::OnCloudPrintProxyDisabled() {
- // Save the preference that we have disabled the cloud print proxy.
- service_prefs_->SetBoolean(prefs::kCloudPrintProxyEnabled, false);
- service_prefs_->WritePrefs();
+void ServiceProcess::OnCloudPrintProxyDisabled(bool persist_state) {
+ if (persist_state) {
+ // Save the preference that we have disabled the cloud print proxy.
+ service_prefs_->SetBoolean(prefs::kCloudPrintProxyEnabled, false);
+ service_prefs_->WritePrefs();
+ }
OnServiceDisabled();
}
« chrome/service/cloud_print/cloud_print_proxy_backend.cc ('K') | « chrome/service/service_process.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698