summaryrefslogtreecommitdiffstats
path: root/chrome/common/child_process_info.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 20:48:45 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 20:48:45 +0000
commit091cb24cf6e999b844ac323113dfd7c645a85711 (patch)
tree2e73beddef0240b3970e6b24fc8f2292e7393407 /chrome/common/child_process_info.cc
parent3dffffc01dbeb813a4a72dd82c63e162d15cab78 (diff)
downloadchromium_src-091cb24cf6e999b844ac323113dfd7c645a85711.zip
chromium_src-091cb24cf6e999b844ac323113dfd7c645a85711.tar.gz
chromium_src-091cb24cf6e999b844ac323113dfd7c645a85711.tar.bz2
Fix some incorrect usages of l10n_util::GetString
I ran into the DCHECK with the GPU process case, although I'm not sure how I triggered it because most of these child process types don't appear to ever show up in the task manager. BUG=none TEST=trybots Review URL: http://codereview.chromium.org/3521019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62012 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/child_process_info.cc')
-rw-r--r--chrome/common/child_process_info.cc56
1 files changed, 35 insertions, 21 deletions
diff --git a/chrome/common/child_process_info.cc b/chrome/common/child_process_info.cc
index a94b89d..41d066b 100644
--- a/chrome/common/child_process_info.cc
+++ b/chrome/common/child_process_info.cc
@@ -82,29 +82,43 @@ string16 ChildProcessInfo::GetLocalizedTitle() const {
// or Arabic word for "plugin".
base::i18n::AdjustStringForLocaleDirection(title, &title);
- int message_id;
- if (type_ == ChildProcessInfo::PLUGIN_PROCESS) {
- message_id = IDS_TASK_MANAGER_PLUGIN_PREFIX;
- return l10n_util::GetStringFUTF16(message_id, title,
- WideToUTF16Hack(version_.c_str()));
- } else if (type_ == ChildProcessInfo::WORKER_PROCESS) {
- message_id = IDS_TASK_MANAGER_WORKER_PREFIX;
- } else if (type_ == ChildProcessInfo::UTILITY_PROCESS) {
- message_id = IDS_TASK_MANAGER_UTILITY_PREFIX;
- } else if (type_ == ChildProcessInfo::PROFILE_IMPORT_PROCESS) {
- message_id = IDS_TASK_MANAGER_PROFILE_IMPORT_PREFIX;
- } else if (type_ == ChildProcessInfo::NACL_LOADER_PROCESS) {
- message_id = IDS_TASK_MANAGER_NACL_PREFIX;
- } else if (type_ == ChildProcessInfo::NACL_BROKER_PROCESS) {
- message_id = IDS_TASK_MANAGER_NACL_BROKER_PREFIX;
- } else if (type_ == ChildProcessInfo::GPU_PROCESS) {
- message_id = IDS_TASK_MANAGER_GPU_PREFIX;
- } else {
- DCHECK(false) << "Need localized name for child process type.";
- return title;
+ switch (type_) {
+ case ChildProcessInfo::UTILITY_PROCESS:
+ return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX);
+
+ case ChildProcessInfo::PROFILE_IMPORT_PROCESS:
+ return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX);
+
+ case ChildProcessInfo::GPU_PROCESS:
+ return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_GPU_PREFIX);
+
+ case ChildProcessInfo::NACL_BROKER_PROCESS:
+ return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NACL_BROKER_PREFIX);
+
+ case ChildProcessInfo::PLUGIN_PROCESS:
+ return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PLUGIN_PREFIX,
+ title,
+ WideToUTF16Hack(version_));
+
+ case ChildProcessInfo::NACL_LOADER_PROCESS:
+ return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NACL_PREFIX, title);
+
+ case ChildProcessInfo::WORKER_PROCESS:
+ return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_WORKER_PREFIX, title);
+
+ // These types don't need display names or get them from elsewhere.
+ case BROWSER_PROCESS:
+ case RENDER_PROCESS:
+ case ZYGOTE_PROCESS:
+ case SANDBOX_HELPER_PROCESS:
+ NOTREACHED();
+ break;
+
+ case UNKNOWN_PROCESS:
+ NOTREACHED() << "Need localized name for child process type.";
}
- return l10n_util::GetStringFUTF16(message_id, title);
+ return title;
}
ChildProcessInfo::ChildProcessInfo(ProcessType type, int id) : type_(type) {