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

Unified Diff: chrome/browser/dom_ui/options/about_page_handler.cc

Issue 6088007: chromeos: Add OS credits link to about page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/app
Patch Set: add #if around cros-only consts Created 10 years 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/app/google_chrome_strings.grd ('k') | chrome/browser/resources/options/about_page.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/options/about_page_handler.cc
diff --git a/chrome/browser/dom_ui/options/about_page_handler.cc b/chrome/browser/dom_ui/options/about_page_handler.cc
index 224befba08460cd69f5deb983ecb0a782904a3f5..846c852bf6000aafcfc0ae7c9165df79c1badfed 100644
--- a/chrome/browser/dom_ui/options/about_page_handler.cc
+++ b/chrome/browser/dom_ui/options/about_page_handler.cc
@@ -49,6 +49,10 @@ const wchar_t kBeginLinkChr[] = L"BEGIN_LINK_CHR";
const wchar_t kBeginLinkOss[] = L"BEGIN_LINK_OSS";
const wchar_t kEndLinkChr[] = L"END_LINK_CHR";
const wchar_t kEndLinkOss[] = L"END_LINK_OSS";
+#if defined(OS_CHROMEOS)
+const wchar_t kBeginLinkCrosOss[] = L"BEGIN_LINK_CROS_OSS";
+const wchar_t kEndLinkCrosOss[] = L"END_LINK_CROS_OSS";
+#endif
// Returns a substring [start, end) from |text|.
std::wstring StringSubRange(const std::wstring& text, size_t start,
@@ -172,7 +176,7 @@ void AboutPageHandler::GetLocalizedValues(DictionaryValue* localized_strings) {
size_t link2 = text.find(kBeginLink, link1_end);
DCHECK(link2 != std::wstring::npos);
size_t link2_end = text.find(kEndLink, link2);
- DCHECK(link1_end != std::wstring::npos);
+ DCHECK(link2_end != std::wstring::npos);
Daniel Erat 2010/12/29 01:11:44 noticed this typo
localized_strings->SetString("license_content_0",
WideToUTF16Hack(text.substr(0, link1)));
@@ -203,6 +207,26 @@ void AboutPageHandler::GetLocalizedValues(DictionaryValue* localized_strings) {
localized_strings->SetString(chromium_url_appears_first ?
"license_link_1" : "license_link_0", chrome::kChromeUIAboutCreditsURL);
+#if defined(OS_CHROMEOS)
+ std::wstring cros_text = l10n_util::GetString(IDS_ABOUT_CROS_VERSION_LICENSE);
+
+ size_t cros_link = cros_text.find(kBeginLinkCrosOss);
+ DCHECK(cros_link != std::wstring::npos);
+ size_t cros_link_end = cros_text.find(kEndLinkCrosOss, cros_link);
+ DCHECK(cros_link_end != std::wstring::npos);
+
+ localized_strings->SetString("cros_license_content_0",
+ WideToUTF16Hack(cros_text.substr(0, cros_link)));
Daniel Erat 2010/12/29 01:11:44 I tried to match the broken indenting of the rest
arv (Not doing code reviews) 2010/12/29 01:26:38 Either way.
+ localized_strings->SetString("cros_license_content_1",
+ WideToUTF16Hack(
+ cros_text.substr(cros_link_end + wcslen(kEndLinkCrosOss))));
+ localized_strings->SetString("cros_license_link_content_0",
+ WideToUTF16Hack(StringSubRange(cros_text,
+ cros_link + wcslen(kBeginLinkCrosOss), cros_link_end)));
+ localized_strings->SetString("cros_license_link_0",
+ chrome::kChromeUIAboutOSCreditsURL);
+#endif
+
// webkit
localized_strings->SetString("webkit_version",
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | chrome/browser/resources/options/about_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698