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

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

Issue 449623003: Integrate About page into Settings for Chrome OS settings in a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simplify Created 6 years, 4 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
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 5b5041e465cc2b159d8b829ea282bc908b432309..9b58c49513848f17c2c02ac2ff4a2ffe8db99e6e 100644
--- a/chrome/browser/ui/webui/help/help_handler.cc
+++ b/chrome/browser/ui/webui/help/help_handler.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
-#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -21,14 +20,12 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/common/chrome_content_client.h"
-#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "components/google/core/browser/google_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_ui.h"
-#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/user_agent.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -60,30 +57,6 @@ using content::BrowserThread;
namespace {
-// Returns the browser version as a string.
-base::string16 BuildBrowserVersionString() {
- chrome::VersionInfo version_info;
- DCHECK(version_info.is_valid());
-
- std::string browser_version = version_info.Version();
- std::string version_modifier =
- chrome::VersionInfo::GetVersionStringModifier();
- if (!version_modifier.empty())
- browser_version += " " + version_modifier;
-
-#if !defined(GOOGLE_CHROME_BUILD)
- browser_version += " (";
- browser_version += version_info.LastChange();
- browser_version += ")";
-#endif
-
-#if defined(ARCH_CPU_64_BITS)
- browser_version += " (64-bit)";
-#endif
-
- return base::UTF8ToUTF16(browser_version);
-}
-
#if defined(OS_CHROMEOS)
// Returns message that informs user that for update it's better to
@@ -144,7 +117,7 @@ HelpHandler::HelpHandler()
HelpHandler::~HelpHandler() {
}
-void HelpHandler::GetLocalizedValues(content::WebUIDataSource* source) {
+void HelpHandler::GetLocalizedValues(base::DictionaryValue* localized_strings) {
struct L10nResources {
const char* name;
int ids;
@@ -219,25 +192,28 @@ void HelpHandler::GetLocalizedValues(content::WebUIDataSource* source) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) {
- source->AddString(resources[i].name,
- l10n_util::GetStringUTF16(resources[i].ids));
+ localized_strings->SetString(resources[i].name,
+ l10n_util::GetStringUTF16(resources[i].ids));
}
#if defined(OS_MACOSX)
- source->AddString("updateObsoleteSystem",
- ObsoleteSystemMac::LocalizedObsoleteSystemString());
- source->AddString("updateObsoleteSystemURL",
- chrome::kMac32BitDeprecationURL);
+ localized_strings->SetString(
+ "updateObsoleteSystem",
+ ObsoleteSystemMac::LocalizedObsoleteSystemString());
+ localized_strings->SetString(
+ "updateObsoleteSystemURL",
+ chrome::kMac32BitDeprecationURL);
#endif
- source->AddString(
+ localized_strings->SetString(
"browserVersion",
- l10n_util::GetStringFUTF16(IDS_ABOUT_PRODUCT_VERSION,
- BuildBrowserVersionString()));
+ l10n_util::GetStringFUTF16(
+ IDS_ABOUT_PRODUCT_VERSION,
+ help_utils_chromeos::BuildBrowserVersionString()));
base::Time::Exploded exploded_time;
base::Time::Now().LocalExplode(&exploded_time);
- source->AddString(
+ localized_strings->SetString(
"productCopyright",
l10n_util::GetStringFUTF16(IDS_ABOUT_VERSION_COPYRIGHT,
base::IntToString16(exploded_time.year)));
@@ -246,21 +222,21 @@ void HelpHandler::GetLocalizedValues(content::WebUIDataSource* source) {
IDS_ABOUT_VERSION_LICENSE,
base::ASCIIToUTF16(chrome::kChromiumProjectURL),
base::ASCIIToUTF16(chrome::kChromeUICreditsURL));
- source->AddString("productLicense", license);
+ localized_strings->SetString("productLicense", license);
#if defined(OS_CHROMEOS)
base::string16 os_license = l10n_util::GetStringFUTF16(
IDS_ABOUT_CROS_VERSION_LICENSE,
base::ASCIIToUTF16(chrome::kChromeUIOSCreditsURL));
- source->AddString("productOsLicense", os_license);
+ localized_strings->SetString("productOsLicense", os_license);
base::string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_OS_NAME);
- source->AddString(
+ localized_strings->SetString(
"channelChangePageDelayedChangeMessage",
l10n_util::GetStringFUTF16(
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_DELAYED_CHANGE_MESSAGE,
product_name));
- source->AddString(
+ localized_strings->SetString(
"channelChangePageUnstableMessage",
l10n_util::GetStringFUTF16(
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_UNSTABLE_MESSAGE,
@@ -268,24 +244,24 @@ void HelpHandler::GetLocalizedValues(content::WebUIDataSource* source) {
if (CommandLine::ForCurrentProcess()->
HasSwitch(chromeos::switches::kDisableNewChannelSwitcherUI)) {
- source->AddBoolean("disableNewChannelSwitcherUI", true);
+ localized_strings->SetBoolean("disableNewChannelSwitcherUI", true);
}
#endif
base::string16 tos = l10n_util::GetStringFUTF16(
IDS_ABOUT_TERMS_OF_SERVICE, base::UTF8ToUTF16(chrome::kChromeUITermsURL));
- source->AddString("productTOS", tos);
+ localized_strings->SetString("productTOS", tos);
- source->AddString("webkitVersion", content::GetWebKitVersion());
+ localized_strings->SetString("webkitVersion", content::GetWebKitVersion());
- source->AddString("jsEngine", "V8");
- source->AddString("jsEngineVersion", v8::V8::GetVersion());
+ localized_strings->SetString("jsEngine", "V8");
+ localized_strings->SetString("jsEngineVersion", v8::V8::GetVersion());
- source->AddString("userAgentInfo", GetUserAgent());
+ localized_strings->SetString("userAgentInfo", GetUserAgent());
CommandLine::StringType command_line =
CommandLine::ForCurrentProcess()->GetCommandLineString();
- source->AddString("commandLineInfo", command_line);
+ localized_strings->SetString("commandLineInfo", command_line);
}
void HelpHandler::RegisterMessages() {

Powered by Google App Engine
This is Rietveld 408576698