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

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: fix tests 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..ce51914ee0995b757ac11853d4b0cf180f872c68 100644
--- a/chrome/browser/ui/webui/help/help_handler.cc
+++ b/chrome/browser/ui/webui/help/help_handler.cc
@@ -20,15 +20,14 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/webui/help/help_utils.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"
@@ -49,7 +48,6 @@
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/help/help_utils_chromeos.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/power_manager_client.h"
@@ -60,36 +58,12 @@ 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
// connect to a network of one of the allowed types.
base::string16 GetAllowedConnectionTypesMessage() {
- if (help_utils_chromeos::IsUpdateOverCellularAllowed()) {
+ if (help_utils::IsUpdateOverCellularAllowed()) {
return l10n_util::GetStringUTF16(IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED);
} else {
return l10n_util::GetStringUTF16(
@@ -144,7 +118,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 +193,27 @@ 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()));
+ help_utils::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