Chromium Code Reviews| Index: chrome/browser/ui/webui/version_handler.cc |
| diff --git a/chrome/browser/ui/webui/version_handler.cc b/chrome/browser/ui/webui/version_handler.cc |
| index ba348d9145632517542ea9e9dca63e9145d39aee..22b32ca4c9ae91780c9981f618022e83f7010921 100644 |
| --- a/chrome/browser/ui/webui/version_handler.cc |
| +++ b/chrome/browser/ui/webui/version_handler.cc |
| @@ -13,10 +13,12 @@ |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/grit/generated_resources.h" |
| #include "components/variations/active_field_trials.h" |
| +#include "components/version_ui/version_ui_constants.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/plugin_service.h" |
| #include "content/public/browser/web_ui.h" |
| #include "content/public/common/content_constants.h" |
| +#include "grit/components_strings.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "url/gurl.h" |
| @@ -33,16 +35,14 @@ void GetFilePaths(const base::FilePath& profile_path, |
| if (!executable_path.empty()) { |
| *exec_path_out = executable_path.LossyDisplayName(); |
| } else { |
| - *exec_path_out = |
| - l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_PATH_NOTFOUND); |
| + *exec_path_out = l10n_util::GetStringUTF16(IDS_VERSION_UI_PATH_NOTFOUND); |
| } |
|
Dan Beam
2015/10/15 04:02:35
nit: no more curlies for either of this conditiona
|
| base::FilePath profile_path_copy(base::MakeAbsoluteFilePath(profile_path)); |
| if (!profile_path.empty() && !profile_path_copy.empty()) { |
| *profile_path_out = profile_path.LossyDisplayName(); |
| } else { |
| - *profile_path_out = |
| - l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_PATH_NOTFOUND); |
| + *profile_path_out = l10n_util::GetStringUTF16(IDS_VERSION_UI_PATH_NOTFOUND); |
| } |
| } |
| @@ -57,9 +57,9 @@ VersionHandler::~VersionHandler() { |
| void VersionHandler::RegisterMessages() { |
| web_ui()->RegisterMessageCallback( |
| - "requestVersionInfo", |
| + version_ui::kRequestVersionInfo, |
| base::Bind(&VersionHandler::HandleRequestVersionInfo, |
| - base::Unretained(this))); |
| + base::Unretained(this))); |
| } |
| void VersionHandler::HandleRequestVersionInfo(const base::ListValue* args) { |
| @@ -112,7 +112,8 @@ void VersionHandler::HandleRequestVersionInfo(const base::ListValue* args) { |
| } |
| // In release mode, this will return an empty list to clear the section. |
| - web_ui()->CallJavascriptFunction("returnVariationInfo", variations_list); |
| + web_ui()->CallJavascriptFunction(version_ui::kReturnVariationInfo, |
| + variations_list); |
| } |
| void VersionHandler::OnGotFilePaths(base::string16* executable_path_data, |
| @@ -121,7 +122,8 @@ void VersionHandler::OnGotFilePaths(base::string16* executable_path_data, |
| base::StringValue exec_path(*executable_path_data); |
| base::StringValue profile_path(*profile_path_data); |
| - web_ui()->CallJavascriptFunction("returnFilePaths", exec_path, profile_path); |
| + web_ui()->CallJavascriptFunction(version_ui::kReturnFilePaths, exec_path, |
| + profile_path); |
| } |
| #if defined(ENABLE_PLUGINS) |
| @@ -145,6 +147,6 @@ void VersionHandler::OnGotPlugins( |
| } |
| base::StringValue arg(flash_version); |
| - web_ui()->CallJavascriptFunction("returnFlashVersion", arg); |
| + web_ui()->CallJavascriptFunction(version_ui::kReturnFlashVersion, arg); |
| } |
| #endif // defined(ENABLE_PLUGINS) |