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

Unified Diff: chrome/browser/ui/webui/version_handler.cc

Issue 1332353003: Move resources for version_ui to //components/version_ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 2 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
« no previous file with comments | « chrome/browser/ui/webui/nacl_ui.cc ('k') | chrome/browser/ui/webui/version_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « chrome/browser/ui/webui/nacl_ui.cc ('k') | chrome/browser/ui/webui/version_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698