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

Unified Diff: chrome/browser/ui/webui/help/help_handler.cc

Issue 680393002: Alt text for About UI product label (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/help/help_handler.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/help/help_handler.cc
diff --git a/chrome/browser/ui/webui/help/help_handler.cc b/chrome/browser/ui/webui/help/help_handler.cc
index d0326c27b4f7bc4d9d3896bd204fe55e6d2a1f2c..97a636af9a22845ca5068b39bf0421082ba7ea21 100644
--- a/chrome/browser/ui/webui/help/help_handler.cc
+++ b/chrome/browser/ui/webui/help/help_handler.cc
@@ -10,8 +10,11 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
+#include "base/files/file_util.h"
+#include "base/location.h"
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -64,6 +67,8 @@ namespace {
#if defined(OS_CHROMEOS)
+const char kFCCLabelTextPath[] = "fcc/label.txt";
+
// Returns message that informs user that for update it's better to
// connect to a network of one of the allowed types.
base::string16 GetAllowedConnectionTypesMessage() {
@@ -384,6 +389,10 @@ void HelpHandler::OnPageLoaded(const base::ListValue* args) {
base::Bind(&HelpHandler::OnCurrentChannel, weak_factory_.GetWeakPtr()));
version_updater_->GetChannel(false,
base::Bind(&HelpHandler::OnTargetChannel, weak_factory_.GetWeakPtr()));
+
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&HelpHandler::LoadFCCLabelText, weak_factory_.GetWeakPtr()));
satorux1 2014/12/04 08:20:04 This code is incorrect. You cannot use a UI-thread
#endif
}
@@ -565,4 +574,16 @@ void HelpHandler::OnTargetChannel(const std::string& channel) {
"help.HelpPage.updateTargetChannel", base::StringValue(channel));
}
+void HelpHandler::LoadFCCLabelText() {
+ base::FilePath path(std::string(chrome::kChromeOSAssetPath) +
+ kFCCLabelTextPath);
+ std::string contents;
+ if (base::ReadFileToString(path, &contents)) {
+ // Remove unnecessary whitespace.
+ base::StringValue label(base::CollapseWhitespaceASCII(contents, true));
+ web_ui()->CallJavascriptFunction("help.HelpPage.setProductLabelText",
satorux1 2014/12/04 08:20:04 This code is probably incorrect too. It looks unsa
+ label);
+ }
+}
+
#endif // defined(OS_CHROMEOS)
« no previous file with comments | « chrome/browser/ui/webui/help/help_handler.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698