| 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..0b6040f62bed82e1f9bf41a5548f178f3453011e 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"
|
|
|
| @@ -30,20 +32,16 @@ void GetFilePaths(const base::FilePath& profile_path,
|
|
|
| base::FilePath executable_path = base::MakeAbsoluteFilePath(
|
| base::CommandLine::ForCurrentProcess()->GetProgram());
|
| - if (!executable_path.empty()) {
|
| + if (!executable_path.empty())
|
| *exec_path_out = executable_path.LossyDisplayName();
|
| - } else {
|
| - *exec_path_out =
|
| - l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_PATH_NOTFOUND);
|
| - }
|
| + else
|
| + *exec_path_out = l10n_util::GetStringUTF16(IDS_VERSION_UI_PATH_NOTFOUND);
|
|
|
| base::FilePath profile_path_copy(base::MakeAbsoluteFilePath(profile_path));
|
| - if (!profile_path.empty() && !profile_path_copy.empty()) {
|
| + 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);
|
| - }
|
| + else
|
| + *profile_path_out = l10n_util::GetStringUTF16(IDS_VERSION_UI_PATH_NOTFOUND);
|
| }
|
|
|
| } // namespace
|
| @@ -57,9 +55,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 +110,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 +120,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 +145,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)
|
|
|