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

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 325963007: Do not append Google locale to help center links (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" 5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #if defined(OS_CHROMEOS) 74 #if defined(OS_CHROMEOS)
75 "https://www.google.com/support/chromeos/bin/answer.py?answer=95464"; 75 "https://www.google.com/support/chromeos/bin/answer.py?answer=95464";
76 #else 76 #else
77 "https://www.google.com/support/chrome/bin/answer.py?answer=95464"; 77 "https://www.google.com/support/chrome/bin/answer.py?answer=95464";
78 #endif 78 #endif
79 79
80 // The URL for the Learn More page shown on guest session new tab. 80 // The URL for the Learn More page shown on guest session new tab.
81 const char kLearnMoreGuestSessionUrl[] = 81 const char kLearnMoreGuestSessionUrl[] =
82 "https://www.google.com/support/chromeos/bin/answer.py?answer=1057090"; 82 "https://www.google.com/support/chromeos/bin/answer.py?answer=1057090";
83 83
84 base::string16 GetUrlWithLang(const GURL& url) { 84 base::string16 GetUrlWithLang(const GURL& url) {
Peter Kasting 2014/06/10 18:58:25 This name is now misleading as we don't do anythin
blundell 2014/06/11 12:07:19 Done.
85 return base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam(url).spec()); 85 return base::ASCIIToUTF16(url.spec());
86 } 86 }
87 87
88 std::string SkColorToRGBAString(SkColor color) { 88 std::string SkColorToRGBAString(SkColor color) {
89 // We convert the alpha using DoubleToString because StringPrintf will use 89 // We convert the alpha using DoubleToString because StringPrintf will use
90 // locale specific formatters (e.g., use , instead of . in German). 90 // locale specific formatters (e.g., use , instead of . in German).
91 return base::StringPrintf( 91 return base::StringPrintf(
92 "rgba(%d,%d,%d,%s)", 92 "rgba(%d,%d,%d,%s)",
93 SkColorGetR(color), 93 SkColorGetR(color),
94 SkColorGetG(color), 94 SkColorGetG(color),
95 SkColorGetB(color), 95 SkColorGetB(color),
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 NTPLoginHandler::ShouldShow(profile_)); 456 NTPLoginHandler::ShouldShow(profile_));
457 load_time_data.SetString("otherSessions", 457 load_time_data.SetString("otherSessions",
458 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LABEL)); 458 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LABEL));
459 load_time_data.SetString("otherSessionsEmpty", 459 load_time_data.SetString("otherSessionsEmpty",
460 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EMPTY)); 460 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EMPTY));
461 load_time_data.SetString("otherSessionsLearnMoreUrl", 461 load_time_data.SetString("otherSessionsLearnMoreUrl",
462 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LEARN_MORE_URL)); 462 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LEARN_MORE_URL));
463 load_time_data.SetString("learnMore", 463 load_time_data.SetString("learnMore",
464 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 464 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
465 load_time_data.SetString("webStoreLink", 465 load_time_data.SetString("webStoreLink",
466 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); 466 GetUrlWithLang(google_util::AppendGoogleLocaleParam(
467 GURL(extension_urls::GetWebstoreLaunchURL()))));
467 load_time_data.SetString("appInstallHintText", 468 load_time_data.SetString("appInstallHintText",
468 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL)); 469 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL));
469 load_time_data.SetBoolean("isDiscoveryInNTPEnabled", 470 load_time_data.SetBoolean("isDiscoveryInNTPEnabled",
470 NewTabUI::IsDiscoveryInNTPEnabled()); 471 NewTabUI::IsDiscoveryInNTPEnabled());
471 load_time_data.SetString("collapseSessionMenuItemText", 472 load_time_data.SetString("collapseSessionMenuItemText",
472 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_COLLAPSE_SESSION)); 473 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_COLLAPSE_SESSION));
473 load_time_data.SetString("expandSessionMenuItemText", 474 load_time_data.SetString("expandSessionMenuItemText",
474 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EXPAND_SESSION)); 475 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EXPAND_SESSION));
475 load_time_data.SetString("restoreSessionMenuItemText", 476 load_time_data.SetString("restoreSessionMenuItemText",
476 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_OPEN_ALL)); 477 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_OPEN_ALL));
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 // Get our template. 721 // Get our template.
721 static const base::StringPiece new_tab_theme_css( 722 static const base::StringPiece new_tab_theme_css(
722 ResourceBundle::GetSharedInstance().GetRawDataResource( 723 ResourceBundle::GetSharedInstance().GetRawDataResource(
723 IDR_NEW_TAB_4_THEME_CSS)); 724 IDR_NEW_TAB_4_THEME_CSS));
724 725
725 // Create the string from our template and the replacements. 726 // Create the string from our template and the replacements.
726 std::string css_string; 727 std::string css_string;
727 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 728 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
728 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 729 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
729 } 730 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698