Chromium Code Reviews

Unified Diff: chrome/browser/ui/webui/options/core_options_handler.cc

Issue 651643006: Show About link in Settings instead of version number for M39 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2171
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome/browser/resources/options/search_box.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/core_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index f6683fbfdf9c7dd6b15d60978d1dcf2a1758cff0..3db9ae5088cb3cd159f4edbfc5d525a8553c7fd9 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/help/help_handler.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -62,6 +61,19 @@ bool CanSetExtensionControlledPrefValue(
#endif
}
+// Hack to re-use IDS_ABOUT, which is a menu item for the About page.
+// Since it's a menu item, it may include a "&" to indicate a hotkey.
+base::string16 GetAboutString() {
+ if (!switches::AboutInSettingsEnabled())
+ return base::string16();
+
+ base::string16 str = l10n_util::GetStringUTF16(IDS_ABOUT);
+ size_t start_pos = str.find(base::ASCIIToUTF16("&"));
+ if (start_pos != base::string16::npos)
+ str.erase(start_pos, 1);
+ return str;
+}
+
} // namespace
CoreOptionsHandler::CoreOptionsHandler()
@@ -147,6 +159,11 @@ void CoreOptionsHandler::GetStaticLocalizedValues(
localized_strings->SetString("searchPageHelpURL",
chrome::kSettingsSearchHelpURL);
+ // About
+ localized_strings->SetBoolean("showAbout",
+ switches::AboutInSettingsEnabled());
+ localized_strings->SetString("aboutButton", GetAboutString());
+
// Common
localized_strings->SetString("ok",
l10n_util::GetStringUTF16(IDS_OK));
@@ -160,12 +177,6 @@ void CoreOptionsHandler::GetStaticLocalizedValues(
l10n_util::GetStringUTF16(IDS_DONE));
localized_strings->SetString("deletableItemDeleteButtonTitle",
l10n_util::GetStringUTF16(IDS_OPTIONS_DELETABLE_ITEM_DELETE_BUTTON));
- localized_strings->SetString(
- "browserVersion",
- l10n_util::GetStringFUTF16(IDS_ABOUT_PRODUCT_VERSION,
- HelpHandler::BuildBrowserVersionString()));
- localized_strings->SetBoolean("showVersion",
- switches::AboutInSettingsEnabled());
}
void CoreOptionsHandler::Uninitialize() {
« no previous file with comments | « chrome/browser/resources/options/search_box.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine