summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-07 19:44:18 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-07 19:44:18 +0000
commitb7ad1dc71f3fd236a76b53d8b1f0d8b44e51a22e (patch)
tree9994ff41d609c09b2d33ed069dc338bd771d94cc
parent972be15c2d194d886b567ba29e865e369de6fb48 (diff)
downloadchromium_src-b7ad1dc71f3fd236a76b53d8b1f0d8b44e51a22e.zip
chromium_src-b7ad1dc71f3fd236a76b53d8b1f0d8b44e51a22e.tar.gz
chromium_src-b7ad1dc71f3fd236a76b53d8b1f0d8b44e51a22e.tar.bz2
Convert browser/dom_ui/n*.cc to not use wstrings/wchar_t*s (insofar as possible).
BUG=23581 TEST=builds and tests pass Review URL: http://codereview.chromium.org/3067039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55359 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/dom_ui/new_tab_page_sync_handler.cc31
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc83
-rw-r--r--chrome/browser/dom_ui/ntp_resource_cache.cc145
3 files changed, 130 insertions, 129 deletions
diff --git a/chrome/browser/dom_ui/new_tab_page_sync_handler.cc b/chrome/browser/dom_ui/new_tab_page_sync_handler.cc
index 9b0d0c9..d52ca0d 100644
--- a/chrome/browser/dom_ui/new_tab_page_sync_handler.cc
+++ b/chrome/browser/dom_ui/new_tab_page_sync_handler.cc
@@ -161,9 +161,9 @@ void NewTabPageSyncHandler::HandleSyncLinkClicked(const Value* value) {
return;
}
DictionaryValue value;
- value.SetString(L"syncEnabledMessage",
- l10n_util::GetStringF(IDS_SYNC_NTP_SYNCED_TO,
- UTF16ToWide(sync_service_->GetAuthenticatedUsername())));
+ value.SetString("syncEnabledMessage",
+ l10n_util::GetStringFUTF16(IDS_SYNC_NTP_SYNCED_TO,
+ sync_service_->GetAuthenticatedUsername()));
dom_ui_->CallJavascriptFunction(L"syncAlreadyEnabled", value);
} else {
// User clicked the 'Start now' link to begin syncing.
@@ -183,36 +183,35 @@ void NewTabPageSyncHandler::SendSyncMessageToPage(
MessageType type, std::string msg,
std::string linktext) {
DictionaryValue value;
- std::wstring user;
+ std::string user;
std::string title;
std::string linkurl;
// If there is no message to show, we should hide the sync section
// altogether.
if (type == HIDE || msg.empty()) {
- value.SetBoolean(L"syncsectionisvisible", false);
+ value.SetBoolean("syncsectionisvisible", false);
} else { // type == SYNC_ERROR
- title = WideToUTF8(
- l10n_util::GetString(IDS_SYNC_NTP_SYNC_SECTION_ERROR_TITLE));
+ title = l10n_util::GetStringUTF8(IDS_SYNC_NTP_SYNC_SECTION_ERROR_TITLE);
- value.SetBoolean(L"syncsectionisvisible", true);
- value.SetString(L"msg", msg);
- value.SetString(L"title", title);
+ value.SetBoolean("syncsectionisvisible", true);
+ value.SetString("msg", msg);
+ value.SetString("title", title);
if (linktext.empty()) {
- value.SetBoolean(L"linkisvisible", false);
+ value.SetBoolean("linkisvisible", false);
} else {
- value.SetBoolean(L"linkisvisible", true);
- value.SetString(L"linktext", linktext);
+ value.SetBoolean("linkisvisible", true);
+ value.SetString("linktext", linktext);
// The only time we set the URL is when the user is synced and we need to
// show a link to a web interface (e.g. http://docs.google.com). When we
// set that URL, HandleSyncLinkClicked won't be called when the user
// clicks on the link.
if (linkurl.empty()) {
- value.SetBoolean(L"linkurlisset", false);
+ value.SetBoolean("linkurlisset", false);
} else {
- value.SetBoolean(L"linkurlisset", true);
- value.SetString(L"linkurl", linkurl);
+ value.SetBoolean("linkurlisset", true);
+ value.SetString("linkurl", linkurl);
}
}
}
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 09da259..dd59fb0 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -48,8 +48,8 @@ const int kSearchURLs = 3;
// Strings sent to the page via jstemplates used to set the direction of the
// HTML document based on locale.
-const wchar_t kRTLHtmlTextDirection[] = L"rtl";
-const wchar_t kDefaultHtmlTextDirection[] = L"ltr";
+const char kRTLHtmlTextDirection[] = "rtl";
+const char kDefaultHtmlTextDirection[] = "ltr";
////////////////////////////////////////////////////////////////////////////////
// PaintTimer
@@ -156,7 +156,7 @@ class RecentlyClosedTabsHandler : public DOMMessageHandler,
// tab was already in the list, true if it was absent. A tab is
// considered unique if no other tab shares both its title and its url.
bool EnsureTabIsUnique(const DictionaryValue* tab,
- std::set<std::wstring>& unique_items);
+ std::set<std::string>* unique_items);
// TabRestoreService that we are observing.
TabRestoreService* tab_restore_service_;
@@ -195,10 +195,10 @@ void RecentlyClosedTabsHandler::HandleReopenTab(const Value* content) {
list_member->GetType() == Value::TYPE_STRING) {
const StringValue* string_value =
static_cast<const StringValue*>(list_member);
- std::wstring wstring_value;
- if (string_value->GetAsString(&wstring_value)) {
+ std::string session_to_restore_str;
+ if (string_value->GetAsString(&session_to_restore_str)) {
int session_to_restore;
- base::StringToInt(WideToUTF8(wstring_value), &session_to_restore);
+ base::StringToInt(session_to_restore_str, &session_to_restore);
tab_restore_service_->RestoreEntryById(browser, session_to_restore,
true);
// The current tab has been nuked at this point; don't touch any member
@@ -232,7 +232,7 @@ void RecentlyClosedTabsHandler::TabRestoreServiceChanged(
TabRestoreService* service) {
const TabRestoreService::Entries& entries = service->entries();
ListValue list_value;
- std::set<std::wstring> unique_items;
+ std::set<std::string> unique_items;
int added_count = 0;
const int max_count = 10;
@@ -245,11 +245,11 @@ void RecentlyClosedTabsHandler::TabRestoreServiceChanged(
DictionaryValue* value = new DictionaryValue();
if ((entry->type == TabRestoreService::TAB &&
TabToValue(*static_cast<TabRestoreService::Tab*>(entry), value) &&
- EnsureTabIsUnique(value, unique_items)) ||
+ EnsureTabIsUnique(value, &unique_items)) ||
(entry->type == TabRestoreService::WINDOW &&
WindowToValue(*static_cast<TabRestoreService::Window*>(entry),
value))) {
- value->SetInteger(L"sessionId", entry->id);
+ value->SetInteger("sessionId", entry->id);
list_value.Append(value);
added_count++;
} else {
@@ -277,8 +277,8 @@ bool RecentlyClosedTabsHandler::TabToValue(
NewTabUI::SetURLTitleAndDirection(dictionary, current_navigation.title(),
current_navigation.virtual_url());
- dictionary->SetString(L"type", L"tab");
- dictionary->SetReal(L"timestamp", tab.timestamp.ToDoubleT());
+ dictionary->SetString("type", "tab");
+ dictionary->SetReal("timestamp", tab.timestamp.ToDoubleT());
return true;
}
@@ -303,23 +303,27 @@ bool RecentlyClosedTabsHandler::WindowToValue(
return false;
}
- dictionary->SetString(L"type", L"window");
- dictionary->SetReal(L"timestamp", window.timestamp.ToDoubleT());
- dictionary->Set(L"tabs", tab_values);
+ dictionary->SetString("type", "window");
+ dictionary->SetReal("timestamp", window.timestamp.ToDoubleT());
+ dictionary->Set("tabs", tab_values);
return true;
}
-bool RecentlyClosedTabsHandler::EnsureTabIsUnique(const DictionaryValue* tab,
- std::set<std::wstring>& unique_items) {
- std::wstring title;
- std::wstring url;
- if (tab->GetString(L"title", &title) &&
- tab->GetString(L"url", &url)) {
- std::wstring unique_key = title + url;
- if (unique_items.find(unique_key) != unique_items.end())
+bool RecentlyClosedTabsHandler::EnsureTabIsUnique(
+ const DictionaryValue* tab,
+ std::set<std::string>* unique_items) {
+ DCHECK(unique_items);
+ std::string title;
+ std::string url;
+ if (tab->GetString("title", &title) &&
+ tab->GetString("url", &url)) {
+ // TODO(viettrungluu): this isn't obviously reliable, since different
+ // combinations of titles/urls may conceivably yield the same string.
+ std::string unique_key = title + url;
+ if (unique_items->find(unique_key) != unique_items->end())
return false;
else
- unique_items.insert(unique_key);
+ unique_items->insert(unique_key);
}
return true;
}
@@ -369,11 +373,11 @@ void MetricsHandler::HandleMetrics(const Value* content) {
list_member->GetType() == Value::TYPE_STRING) {
const StringValue* string_value =
static_cast<const StringValue*>(list_member);
- std::wstring wstring_value;
- if (string_value->GetAsString(&wstring_value)) {
- UserMetrics::RecordComputedAction(WideToASCII(wstring_value),
- dom_ui_->GetProfile());
- }
+ std::string string_action;
+ // TODO(viettrungluu): this usage of |RecordComputedAction()| doesn't
+ // conform with the docs; scripts can't pick this up.
+ if (string_value->GetAsString(&string_action))
+ UserMetrics::RecordComputedAction(string_action, dom_ui_->GetProfile());
}
}
}
@@ -424,9 +428,9 @@ void NewTabPageSetHomePageHandler::HandleSetHomePage(
true);
ListValue list_value;
list_value.Append(new StringValue(
- l10n_util::GetString(IDS_NEW_TAB_HOME_PAGE_SET_NOTIFICATION)));
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_HOME_PAGE_SET_NOTIFICATION)));
list_value.Append(new StringValue(
- l10n_util::GetString(IDS_NEW_TAB_HOME_PAGE_HIDE_NOTIFICATION)));
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_HOME_PAGE_HIDE_NOTIFICATION)));
dom_ui_->CallJavascriptFunction(L"onHomePageSet", list_value);
}
@@ -443,7 +447,7 @@ NewTabUI::NewTabUI(TabContents* contents)
force_extension_shelf_visible_ = true;
focus_location_bar_by_default_ = true;
should_hide_url_ = true;
- overridden_title_ = WideToUTF16Hack(l10n_util::GetString(IDS_NEW_TAB_TITLE));
+ overridden_title_ = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE);
// We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more
// highly. Note this means we're including clicks on not only most visited
@@ -577,16 +581,13 @@ bool NewTabUI::FirstRunDisabled() {
void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary,
const string16& title,
const GURL& gurl) {
- std::wstring wstring_url = UTF8ToWide(gurl.spec());
- dictionary->SetString(L"url", wstring_url);
-
- std::wstring wstring_title = UTF16ToWide(title);
+ dictionary->SetString("url", gurl.spec());
bool using_url_as_the_title = false;
- std::wstring title_to_set(wstring_title);
+ string16 title_to_set(title);
if (title_to_set.empty()) {
using_url_as_the_title = true;
- title_to_set = wstring_url;
+ title_to_set = UTF8ToUTF16(gurl.spec());
}
// We set the "dir" attribute of the title, so that in RTL locales, a LTR
@@ -609,12 +610,12 @@ void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary,
// entire title within a tooltip when the mouse is over the title link.. For
// example, without LRE-PDF pair, the title "Yahoo!" will be rendered as
// "!Yahoo" within the tooltip when the mouse is over the title link.
- std::wstring direction = kDefaultHtmlTextDirection;
+ std::string direction = kDefaultHtmlTextDirection;
if (base::i18n::IsRTL()) {
if (using_url_as_the_title) {
base::i18n::WrapStringWithLTRFormatting(&title_to_set);
} else {
- if (base::i18n::StringContainsStrongRTLChars(wstring_title)) {
+ if (base::i18n::StringContainsStrongRTLChars(title)) {
base::i18n::WrapStringWithRTLFormatting(&title_to_set);
direction = kRTLHtmlTextDirection;
} else {
@@ -622,8 +623,8 @@ void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary,
}
}
}
- dictionary->SetString(L"title", title_to_set);
- dictionary->SetString(L"direction", direction);
+ dictionary->SetString("title", title_to_set);
+ dictionary->SetString("direction", direction);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/dom_ui/ntp_resource_cache.cc b/chrome/browser/dom_ui/ntp_resource_cache.cc
index 2cb54d5..94fff13 100644
--- a/chrome/browser/dom_ui/ntp_resource_cache.cc
+++ b/chrome/browser/dom_ui/ntp_resource_cache.cc
@@ -14,6 +14,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/ref_counted_memory.h"
+#include "base/string16.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
@@ -60,8 +61,8 @@ const char kSyncServiceHelpUrl[] =
const char kHelpContentUrl[] =
"http://www.google.com/support/chrome/";
-std::wstring GetUrlWithLang(const GURL& url) {
- return ASCIIToWide(google_util::AppendGoogleLocaleParam(url).spec());
+string16 GetUrlWithLang(const GURL& url) {
+ return ASCIIToUTF16(google_util::AppendGoogleLocaleParam(url).spec());
}
std::string SkColorToRGBAString(SkColor color) {
@@ -191,18 +192,18 @@ void NTPResourceCache::Observe(NotificationType type,
void NTPResourceCache::CreateNewTabIncognitoHTML() {
DictionaryValue localized_strings;
- localized_strings.SetString(L"title",
- l10n_util::GetString(IDS_NEW_TAB_TITLE));
- localized_strings.SetString(L"content",
- l10n_util::GetStringF(IDS_NEW_TAB_OTR_MESSAGE,
- GetUrlWithLang(GURL(kLearnMoreIncognitoUrl))));
- localized_strings.SetString(L"extensionsmessage",
- l10n_util::GetStringF(IDS_NEW_TAB_OTR_EXTENSIONS_MESSAGE,
- l10n_util::GetString(IDS_PRODUCT_NAME),
- ASCIIToWide(chrome::kChromeUIExtensionsURL)));
+ localized_strings.SetString("title",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
+ localized_strings.SetString("content",
+ l10n_util::GetStringFUTF16(IDS_NEW_TAB_OTR_MESSAGE,
+ GetUrlWithLang(GURL(kLearnMoreIncognitoUrl))));
+ localized_strings.SetString("extensionsmessage",
+ l10n_util::GetStringFUTF16(IDS_NEW_TAB_OTR_EXTENSIONS_MESSAGE,
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
+ ASCIIToUTF16(chrome::kChromeUIExtensionsURL)));
bool bookmark_bar_attached = profile_->GetPrefs()->GetBoolean(
prefs::kShowBookmarkBar);
- localized_strings.SetString(L"bookmarkbarattached",
+ localized_strings.SetString("bookmarkbarattached",
bookmark_bar_attached ? "true" : "false");
ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings);
@@ -223,92 +224,92 @@ void NTPResourceCache::CreateNewTabIncognitoHTML() {
void NTPResourceCache::CreateNewTabHTML() {
// Show the profile name in the title and most visited labels if the current
// profile is not the default.
- std::wstring title = l10n_util::GetString(IDS_NEW_TAB_TITLE);
- std::wstring most_visited = l10n_util::GetString(IDS_NEW_TAB_MOST_VISITED);
+ string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE);
+ string16 most_visited = l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED);
DictionaryValue localized_strings;
- localized_strings.SetString(L"bookmarkbarattached",
+ localized_strings.SetString("bookmarkbarattached",
profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ?
"true" : "false");
- localized_strings.SetString(L"hasattribution",
+ localized_strings.SetString("hasattribution",
profile_->GetThemeProvider()->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION) ?
"true" : "false");
- localized_strings.SetString(L"title", title);
- localized_strings.SetString(L"mostvisited", most_visited);
- localized_strings.SetString(L"restorethumbnails",
- l10n_util::GetString(IDS_NEW_TAB_RESTORE_THUMBNAILS_LINK));
- localized_strings.SetString(L"recentlyclosed",
- l10n_util::GetString(IDS_NEW_TAB_RECENTLY_CLOSED));
- localized_strings.SetString(L"closedwindowsingle",
- l10n_util::GetString(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE));
- localized_strings.SetString(L"closedwindowmultiple",
- l10n_util::GetString(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE));
- localized_strings.SetString(L"attributionintro",
- l10n_util::GetString(IDS_NEW_TAB_ATTRIBUTION_INTRO));
- localized_strings.SetString(L"thumbnailremovednotification",
- l10n_util::GetString(IDS_NEW_TAB_THUMBNAIL_REMOVED_NOTIFICATION));
- localized_strings.SetString(L"undothumbnailremove",
- l10n_util::GetString(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE));
- localized_strings.SetString(L"removethumbnailtooltip",
- l10n_util::GetString(IDS_NEW_TAB_REMOVE_THUMBNAIL_TOOLTIP));
- localized_strings.SetString(L"pinthumbnailtooltip",
- l10n_util::GetString(IDS_NEW_TAB_PIN_THUMBNAIL_TOOLTIP));
- localized_strings.SetString(L"unpinthumbnailtooltip",
- l10n_util::GetString(IDS_NEW_TAB_UNPIN_THUMBNAIL_TOOLTIP));
- localized_strings.SetString(L"showhidethumbnailtooltip",
- l10n_util::GetString(IDS_NEW_TAB_SHOW_HIDE_THUMBNAIL_TOOLTIP));
- localized_strings.SetString(L"showhidelisttooltip",
- l10n_util::GetString(IDS_NEW_TAB_SHOW_HIDE_LIST_TOOLTIP));
- localized_strings.SetString(L"pagedisplaytooltip",
- l10n_util::GetString(IDS_NEW_TAB_PAGE_DISPLAY_TOOLTIP));
- localized_strings.SetString(L"firstrunnotification",
- l10n_util::GetString(IDS_NEW_TAB_FIRST_RUN_NOTIFICATION));
- localized_strings.SetString(L"closefirstrunnotification",
- l10n_util::GetString(IDS_NEW_TAB_CLOSE_FIRST_RUN_NOTIFICATION));
- localized_strings.SetString(L"tips",
- l10n_util::GetString(IDS_NEW_TAB_TIPS));
- localized_strings.SetString(L"close", l10n_util::GetString(IDS_CLOSE));
- localized_strings.SetString(L"history",
- l10n_util::GetString(IDS_NEW_TAB_HISTORY));
- localized_strings.SetString(L"downloads",
- l10n_util::GetString(IDS_NEW_TAB_DOWNLOADS));
- localized_strings.SetString(L"help",
- l10n_util::GetString(IDS_NEW_TAB_HELP));
- localized_strings.SetString(L"helpurl",
+ localized_strings.SetString("title", title);
+ localized_strings.SetString("mostvisited", most_visited);
+ localized_strings.SetString("restorethumbnails",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_RESTORE_THUMBNAILS_LINK));
+ localized_strings.SetString("recentlyclosed",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED));
+ localized_strings.SetString("closedwindowsingle",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE));
+ localized_strings.SetString("closedwindowmultiple",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE));
+ localized_strings.SetString("attributionintro",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_ATTRIBUTION_INTRO));
+ localized_strings.SetString("thumbnailremovednotification",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_THUMBNAIL_REMOVED_NOTIFICATION));
+ localized_strings.SetString("undothumbnailremove",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE));
+ localized_strings.SetString("removethumbnailtooltip",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_REMOVE_THUMBNAIL_TOOLTIP));
+ localized_strings.SetString("pinthumbnailtooltip",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_PIN_THUMBNAIL_TOOLTIP));
+ localized_strings.SetString("unpinthumbnailtooltip",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_UNPIN_THUMBNAIL_TOOLTIP));
+ localized_strings.SetString("showhidethumbnailtooltip",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_SHOW_HIDE_THUMBNAIL_TOOLTIP));
+ localized_strings.SetString("showhidelisttooltip",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_SHOW_HIDE_LIST_TOOLTIP));
+ localized_strings.SetString("pagedisplaytooltip",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_PAGE_DISPLAY_TOOLTIP));
+ localized_strings.SetString("firstrunnotification",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_FIRST_RUN_NOTIFICATION));
+ localized_strings.SetString("closefirstrunnotification",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_FIRST_RUN_NOTIFICATION));
+ localized_strings.SetString("tips",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_TIPS));
+ localized_strings.SetString("close", l10n_util::GetStringUTF16(IDS_CLOSE));
+ localized_strings.SetString("history",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_HISTORY));
+ localized_strings.SetString("downloads",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_DOWNLOADS));
+ localized_strings.SetString("help",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_HELP));
+ localized_strings.SetString("helpurl",
GetUrlWithLang(GURL(kHelpContentUrl)));
- localized_strings.SetString(L"appsettings",
- l10n_util::GetString(IDS_NEW_TAB_APP_SETTINGS));
- localized_strings.SetString(L"appuninstall",
- l10n_util::GetString(IDS_NEW_TAB_APP_UNINSTALL));
- localized_strings.SetString(L"appoptions",
- l10n_util::GetString(IDS_NEW_TAB_APP_OPTIONS));
- localized_strings.SetString(L"web_store_title",
- l10n_util::GetString(IDS_EXTENSION_WEB_STORE_TITLE));
- localized_strings.SetString(L"web_store_url",
+ localized_strings.SetString("appsettings",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_SETTINGS));
+ localized_strings.SetString("appuninstall",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_UNINSTALL));
+ localized_strings.SetString("appoptions",
+ l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_OPTIONS));
+ localized_strings.SetString("web_store_title",
+ l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE));
+ localized_strings.SetString("web_store_url",
GetUrlWithLang(GURL(Extension::ChromeStoreURL())));
// Don't initiate the sync related message passing with the page if the sync
// code is not present.
if (profile_->GetProfileSyncService())
- localized_strings.SetString(L"syncispresent", "true");
+ localized_strings.SetString("syncispresent", "true");
else
- localized_strings.SetString(L"syncispresent", "false");
+ localized_strings.SetString("syncispresent", "false");
ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings);
// Control fade and resize animations.
std::string anim =
Animation::ShouldRenderRichAnimation() ? "true" : "false";
- localized_strings.SetString(L"anim", anim);
+ localized_strings.SetString("anim", anim);
const CommandLine* command_line = CommandLine::ForCurrentProcess();
bool has_3d =
command_line->HasSwitch(switches::kEnableAcceleratedCompositing);
- localized_strings.SetString(L"has_3d", has_3d ? "true" : "false");
+ localized_strings.SetString("has_3d", has_3d ? "true" : "false");
// Pass the shown_sections pref early so that we can prevent flicker.
const int shown_sections = profile_->GetPrefs()->GetInteger(
prefs::kNTPShownSections);
- localized_strings.SetInteger(L"shown_sections", shown_sections);
+ localized_strings.SetInteger("shown_sections", shown_sections);
base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance().
GetRawDataResource(IDR_NEW_NEW_TAB_HTML));