summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_signin.cc2
-rw-r--r--chrome/browser/chromeos/webui/accounts_options_handler.cc6
-rw-r--r--chrome/browser/chromeos/webui/core_chromeos_options_handler.cc4
-rw-r--r--chrome/browser/chromeos/webui/cros_language_options_handler.cc6
-rw-r--r--chrome/browser/chromeos/webui/imageburner_ui.cc22
-rw-r--r--chrome/browser/chromeos/webui/internet_options_handler.cc8
-rw-r--r--chrome/browser/chromeos/webui/keyboard_overlay_ui.cc2
-rw-r--r--chrome/browser/chromeos/webui/menu_ui.cc2
-rw-r--r--chrome/browser/chromeos/webui/mobile_setup_ui.cc4
-rw-r--r--chrome/browser/chromeos/webui/register_page_ui.cc6
-rw-r--r--chrome/browser/chromeos/webui/system_options_handler.cc2
-rw-r--r--chrome/browser/chromeos/webui/wrench_menu_ui.cc2
-rw-r--r--chrome/browser/extensions/extensions_ui.cc14
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc4
-rw-r--r--chrome/browser/printing/print_dialog_cloud.cc6
-rw-r--r--chrome/browser/remoting/remoting_options_handler.cc2
-rw-r--r--chrome/browser/remoting/setup_flow.cc4
-rw-r--r--chrome/browser/remoting/setup_flow_get_status_step.cc2
-rw-r--r--chrome/browser/remoting/setup_flow_login_step.cc2
-rw-r--r--chrome/browser/remoting/setup_flow_register_step.cc2
-rw-r--r--chrome/browser/remoting/setup_flow_start_host_step.cc2
-rw-r--r--chrome/browser/resources/imageburner.html2
-rw-r--r--chrome/browser/sync/sync_setup_flow.cc12
-rw-r--r--chrome/browser/ui/views/select_file_dialog.cc4
-rw-r--r--chrome/browser/ui/views/textfield_views.cc2
-rw-r--r--chrome/browser/ui/webui/app_launcher_handler.cc8
-rw-r--r--chrome/browser/ui/webui/bug_report_ui.cc6
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.cc2
-rw-r--r--chrome/browser/ui/webui/crashes_ui.cc2
-rw-r--r--chrome/browser/ui/webui/downloads_dom_handler.cc6
-rw-r--r--chrome/browser/ui/webui/file_browse_browsertest.cc2
-rw-r--r--chrome/browser/ui/webui/filebrowse_ui.cc34
-rw-r--r--chrome/browser/ui/webui/flags_ui.cc2
-rw-r--r--chrome/browser/ui/webui/foreign_session_handler.cc8
-rw-r--r--chrome/browser/ui/webui/gpu_internals_ui.cc6
-rw-r--r--chrome/browser/ui/webui/history2_ui.cc8
-rw-r--r--chrome/browser/ui/webui/history_ui.cc8
-rw-r--r--chrome/browser/ui/webui/mediaplayer_ui.cc2
-rw-r--r--chrome/browser/ui/webui/most_visited_handler.cc6
-rw-r--r--chrome/browser/ui/webui/net_internals_ui.cc4
-rw-r--r--chrome/browser/ui/webui/new_tab_page_sync_handler.cc4
-rw-r--r--chrome/browser/ui/webui/new_tab_ui.cc14
-rw-r--r--chrome/browser/ui/webui/ntp_login_handler.cc2
-rw-r--r--chrome/browser/ui/webui/options/about_page_handler.cc14
-rw-r--r--chrome/browser/ui/webui/options/add_startup_page_handler.cc4
-rw-r--r--chrome/browser/ui/webui/options/advanced_options_handler.cc29
-rw-r--r--chrome/browser/ui/webui/options/autofill_options_handler.cc9
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.cc11
-rw-r--r--chrome/browser/ui/webui/options/certificate_manager_handler.cc36
-rw-r--r--chrome/browser/ui/webui/options/clear_browser_data_handler.cc6
-rw-r--r--chrome/browser/ui/webui/options/content_settings_handler.cc40
-rw-r--r--chrome/browser/ui/webui/options/cookies_view_handler.cc6
-rw-r--r--chrome/browser/ui/webui/options/core_options_handler.cc7
-rw-r--r--chrome/browser/ui/webui/options/font_settings_handler.cc10
-rw-r--r--chrome/browser/ui/webui/options/import_data_handler.cc9
-rw-r--r--chrome/browser/ui/webui/options/language_options_handler_common.cc7
-rw-r--r--chrome/browser/ui/webui/options/options_managed_banner_handler.cc8
-rw-r--r--chrome/browser/ui/webui/options/options_ui.cc2
-rw-r--r--chrome/browser/ui/webui/options/password_manager_handler.cc12
-rw-r--r--chrome/browser/ui/webui/options/personal_options_handler.cc33
-rw-r--r--chrome/browser/ui/webui/options/search_engine_manager_handler.cc6
-rw-r--r--chrome/browser/ui/webui/plugins_ui.cc4
-rw-r--r--chrome/browser/ui/webui/print_preview_handler.cc2
-rw-r--r--chrome/browser/ui/webui/print_preview_ui.cc2
-rw-r--r--chrome/browser/ui/webui/shown_sections_handler.cc4
-rw-r--r--chrome/browser/ui/webui/slideshow_ui.cc6
-rw-r--r--chrome/browser/ui/webui/sync_internals_ui.cc2
-rw-r--r--chrome/browser/ui/webui/sync_internals_ui_unittest.cc14
-rw-r--r--chrome/browser/ui/webui/textfields_ui.cc3
-rw-r--r--chrome/browser/ui/webui/tips_handler.cc4
70 files changed, 270 insertions, 268 deletions
diff --git a/chrome/browser/browser_signin.cc b/chrome/browser/browser_signin.cc
index 225f126..b3d1d5da 100644
--- a/chrome/browser/browser_signin.cc
+++ b/chrome/browser/browser_signin.cc
@@ -159,7 +159,7 @@ void BrowserSigninHtml::ForceDialogClose() {
StringValue value("DialogClose");
ListValue close_args;
close_args.Append(new StringValue(""));
- web_ui_->CallJavascriptFunction(L"chrome.send", value, close_args);
+ web_ui_->CallJavascriptFunction("chrome.send", value, close_args);
}
}
diff --git a/chrome/browser/chromeos/webui/accounts_options_handler.cc b/chrome/browser/chromeos/webui/accounts_options_handler.cc
index 61f9c8a..72b4b97 100644
--- a/chrome/browser/chromeos/webui/accounts_options_handler.cc
+++ b/chrome/browser/chromeos/webui/accounts_options_handler.cc
@@ -108,8 +108,8 @@ void AccountsOptionsHandler::FetchUserPictures(const ListValue* args) {
user_pictures.SetWithoutPathExpansion(it->email(), image_url);
}
- web_ui_->CallJavascriptFunction(L"AccountsOptions.setUserPictures",
- user_pictures);
+ web_ui_->CallJavascriptFunction("AccountsOptions.setUserPictures",
+ user_pictures);
}
void AccountsOptionsHandler::WhitelistExistingUsers(const ListValue* args) {
@@ -129,7 +129,7 @@ void AccountsOptionsHandler::WhitelistExistingUsers(const ListValue* args) {
}
}
- web_ui_->CallJavascriptFunction(L"AccountsOptions.addUsers", whitelist_users);
+ web_ui_->CallJavascriptFunction("AccountsOptions.addUsers", whitelist_users);
}
void AccountsOptionsHandler::Initialize() {
diff --git a/chrome/browser/chromeos/webui/core_chromeos_options_handler.cc b/chrome/browser/chromeos/webui/core_chromeos_options_handler.cc
index a847bce..25d2c27 100644
--- a/chrome/browser/chromeos/webui/core_chromeos_options_handler.cc
+++ b/chrome/browser/chromeos/webui/core_chromeos_options_handler.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/string_number_conversions.h"
+#include "base/string_util.h"
#include "chrome/browser/chromeos/cros_settings.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "content/common/notification_details.h"
@@ -88,7 +89,8 @@ void CoreChromeOSOptionsHandler::NotifySettingsChanged(
ListValue result_value;
result_value.Append(Value::CreateStringValue(setting_name->c_str()));
result_value.Append(value->DeepCopy());
- web_ui_->CallJavascriptFunction(callback_function, result_value);
+ web_ui_->CallJavascriptFunction(WideToASCII(callback_function),
+ result_value);
}
if (value)
delete value;
diff --git a/chrome/browser/chromeos/webui/cros_language_options_handler.cc b/chrome/browser/chromeos/webui/cros_language_options_handler.cc
index 5ea1cba..1d2de01 100644
--- a/chrome/browser/chromeos/webui/cros_language_options_handler.cc
+++ b/chrome/browser/chromeos/webui/cros_language_options_handler.cc
@@ -202,7 +202,7 @@ void CrosLanguageOptionsHandler::RestartCallback(const ListValue* args) {
void CrosLanguageOptionsHandler::InputMethodDisableCallback(
const ListValue* args) {
- const std::string input_method_id = WideToASCII(ExtractStringValue(args));
+ const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args));
const std::string action = StringPrintf(
"LanguageOptions_DisableInputMethod_%s", input_method_id.c_str());
UserMetrics::RecordComputedAction(action);
@@ -210,7 +210,7 @@ void CrosLanguageOptionsHandler::InputMethodDisableCallback(
void CrosLanguageOptionsHandler::InputMethodEnableCallback(
const ListValue* args) {
- const std::string input_method_id = WideToASCII(ExtractStringValue(args));
+ const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args));
const std::string action = StringPrintf(
"LanguageOptions_EnableInputMethod_%s", input_method_id.c_str());
UserMetrics::RecordComputedAction(action);
@@ -218,7 +218,7 @@ void CrosLanguageOptionsHandler::InputMethodEnableCallback(
void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback(
const ListValue* args) {
- const std::string input_method_id = WideToASCII(ExtractStringValue(args));
+ const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args));
const std::string action = StringPrintf(
"InputMethodOptions_Open_%s", input_method_id.c_str());
UserMetrics::RecordComputedAction(action);
diff --git a/chrome/browser/chromeos/webui/imageburner_ui.cc b/chrome/browser/chromeos/webui/imageburner_ui.cc
index 33e79e1..e755a19 100644
--- a/chrome/browser/chromeos/webui/imageburner_ui.cc
+++ b/chrome/browser/chromeos/webui/imageburner_ui.cc
@@ -222,7 +222,7 @@ void ImageBurnHandler::MountChanged(chromeos::MountLibrary* obj,
if ((evt == chromeos::DISK_REMOVED ||
evt == chromeos::DISK_CHANGED ||
evt == chromeos::DEVICE_REMOVED)) {
- web_ui_->CallJavascriptFunction(L"rootsChanged");
+ web_ui_->CallJavascriptFunction("rootsChanged");
}
}
@@ -247,7 +247,7 @@ void ImageBurnHandler::OnDownloadUpdated(DownloadItem* download) {
&& download->state() != DownloadItem::COMPLETE) {
scoped_ptr<DictionaryValue> result_value(
download_util::CreateDownloadItemValue(download, 0));
- web_ui_->CallJavascriptFunction(L"downloadUpdated", *result_value);
+ web_ui_->CallJavascriptFunction("downloadUpdated", *result_value);
}
if (download->state() == DownloadItem::CANCELLED)
DownloadCompleted(false);
@@ -306,7 +306,7 @@ void ImageBurnHandler::HandleGetRoots(const ListValue* args) {
}
info_value.SetString("functionCall", "getRoots");
info_value.SetString(std::string(kPropertyPath), "");
- web_ui_->CallJavascriptFunction(L"browseFileResult",
+ web_ui_->CallJavascriptFunction("browseFileResult",
info_value, results_value);
}
@@ -339,12 +339,12 @@ void ImageBurnHandler::DownloadCompleted(bool is_successful) {
DictionaryValue signal_value;
if (is_successful) {
signal_value.SetString("state", "COMPLETE");
- web_ui_->CallJavascriptFunction(L"downloadUpdated", signal_value);
- web_ui_->CallJavascriptFunction(L"promtUserDownloadFinished");
+ web_ui_->CallJavascriptFunction("downloadUpdated", signal_value);
+ web_ui_->CallJavascriptFunction("promptUserDownloadFinished");
} else {
signal_value.SetString("state", "CANCELLED");
- web_ui_->CallJavascriptFunction(L"downloadUpdated", signal_value);
- web_ui_->CallJavascriptFunction(L"alertUserDownloadAborted");
+ web_ui_->CallJavascriptFunction("downloadUpdated", signal_value);
+ web_ui_->CallJavascriptFunction("alertUserDownloadAborted");
}
}
@@ -357,14 +357,14 @@ void ImageBurnHandler::BurnImage() {
signal_value.SetString("path", image_target_.value());
signal_value.SetInteger("received", 0);
signal_value.SetString("progress_status_text", "");
- web_ui_->CallJavascriptFunction(L"burnProgressUpdated", signal_value);
+ web_ui_->CallJavascriptFunction("burnProgressUpdated", signal_value);
}
}
void ImageBurnHandler::FinalizeBurn(bool successful) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- web_ui_->CallJavascriptFunction(successful ?
- L"burnSuccessful" : L"burnUnsuccessful");
+ web_ui_->CallJavascriptFunction(successful ? "burnSuccessful"
+ : "burnUnsuccessful");
}
void ImageBurnHandler::UpdateBurnProgress(int64 total_burnt,
@@ -384,7 +384,7 @@ void ImageBurnHandler::UpdateBurnProgress(int64 total_burnt,
progress_value.SetInteger("total", image_size);
progress_value.SetString("path", path);
- web_ui_->CallJavascriptFunction(L"burnProgressUpdated", progress_value);
+ web_ui_->CallJavascriptFunction("burnProgressUpdated", progress_value);
}
string16 ImageBurnHandler::GetBurnProgressText(int64 total_burnt,
diff --git a/chrome/browser/chromeos/webui/internet_options_handler.cc b/chrome/browser/chromeos/webui/internet_options_handler.cc
index e824155..f909f79 100644
--- a/chrome/browser/chromeos/webui/internet_options_handler.cc
+++ b/chrome/browser/chromeos/webui/internet_options_handler.cc
@@ -373,7 +373,7 @@ void InternetOptionsHandler::RefreshNetworkData(
DictionaryValue dictionary;
FillNetworkInfo(&dictionary, cros);
web_ui_->CallJavascriptFunction(
- L"options.InternetOptions.refreshNetworkData", dictionary);
+ "options.InternetOptions.refreshNetworkData", dictionary);
}
void InternetOptionsHandler::OnNetworkManagerChanged(
@@ -439,7 +439,7 @@ void InternetOptionsHandler::OnCellularDataPlanChanged(
connection_plans.Set("plans", plan_list);
SetActivationButtonVisibility(cellular, &connection_plans);
web_ui_->CallJavascriptFunction(
- L"options.InternetOptions.updateCellularPlans", connection_plans);
+ "options.InternetOptions.updateCellularPlans", connection_plans);
}
DictionaryValue* InternetOptionsHandler::CellularDataPlanToDictionary(
@@ -566,7 +566,7 @@ void InternetOptionsHandler::PopulateDictionaryDetails(
}
web_ui_->CallJavascriptFunction(
- L"options.InternetOptions.showDetailedInfo", dictionary);
+ "options.InternetOptions.showDetailedInfo", dictionary);
}
void InternetOptionsHandler::PopulateWifiDetails(
@@ -794,7 +794,7 @@ void InternetOptionsHandler::HandleWifiButtonClick(
DictionaryValue dictionary;
dictionary.SetString("servicePath", network->service_path());
web_ui_->CallJavascriptFunction(
- L"options.InternetOptions.showPasswordEntry", dictionary);
+ "options.InternetOptions.showPasswordEntry", dictionary);
}
} else {
CreateModalPopup(new chromeos::NetworkConfigView(network));
diff --git a/chrome/browser/chromeos/webui/keyboard_overlay_ui.cc b/chrome/browser/chromeos/webui/keyboard_overlay_ui.cc
index 279afb6..38d2d4c 100644
--- a/chrome/browser/chromeos/webui/keyboard_overlay_ui.cc
+++ b/chrome/browser/chromeos/webui/keyboard_overlay_ui.cc
@@ -285,7 +285,7 @@ void KeyboardOverlayHandler::GetKeyboardOverlayId(const ListValue* args) {
const std::string keyboard_overlay_id =
library->GetKeyboardOverlayId(descriptor.id);
StringValue param(keyboard_overlay_id);
- web_ui_->CallJavascriptFunction(L"initKeyboardOverlayId", param);
+ web_ui_->CallJavascriptFunction("initKeyboardOverlayId", param);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/chromeos/webui/menu_ui.cc b/chrome/browser/chromeos/webui/menu_ui.cc
index 8af1bae..66b9aeb 100644
--- a/chrome/browser/chromeos/webui/menu_ui.cc
+++ b/chrome/browser/chromeos/webui/menu_ui.cc
@@ -591,7 +591,7 @@ void MenuUI::ModelUpdated(const ui::MenuModel* model) {
json_model.SetInteger("maxIconWidth", max_icon_width);
json_model.SetBoolean("isRoot", widget->is_root());
json_model.SetBoolean("hasAccelerator", has_accelerator);
- CallJavascriptFunction(L"updateModel", json_model);
+ CallJavascriptFunction("updateModel", json_model);
}
DictionaryValue* MenuUI::CreateMenuItem(const ui::MenuModel* model,
diff --git a/chrome/browser/chromeos/webui/mobile_setup_ui.cc b/chrome/browser/chromeos/webui/mobile_setup_ui.cc
index ea9da6f..ddcd6a0 100644
--- a/chrome/browser/chromeos/webui/mobile_setup_ui.cc
+++ b/chrome/browser/chromeos/webui/mobile_setup_ui.cc
@@ -47,8 +47,8 @@ namespace {
const char kJsApiStartActivation[] = "startActivation";
const char kJsApiSetTransactionStatus[] = "setTransactionStatus";
-const wchar_t kJsDeviceStatusChangedHandler[] =
- L"mobile.MobileSetup.deviceStateChanged";
+const char kJsDeviceStatusChangedHandler[] =
+ "mobile.MobileSetup.deviceStateChanged";
// Error codes matching codes defined in the cellular config file.
const char kErrorDefault[] = "default";
diff --git a/chrome/browser/chromeos/webui/register_page_ui.cc b/chrome/browser/chromeos/webui/register_page_ui.cc
index 6e5d674..7d2cd7e 100644
--- a/chrome/browser/chromeos/webui/register_page_ui.cc
+++ b/chrome/browser/chromeos/webui/register_page_ui.cc
@@ -35,9 +35,9 @@ const char kJsCallbackGetRegistrationUrl[] = "getRegistrationUrl";
const char kJsCallbackUserInfo[] = "getUserInfo";
// Host page JS API function names.
-const wchar_t kJsApiSetRegistrationUrl[] = L"setRegistrationUrl";
-const wchar_t kJsApiSetUserInfo[] = L"setUserInfo";
-const wchar_t kJsApiSkipRegistration[] = L"skipRegistration";
+const char kJsApiSetRegistrationUrl[] = "setRegistrationUrl";
+const char kJsApiSetUserInfo[] = "setUserInfo";
+const char kJsApiSkipRegistration[] = "skipRegistration";
// Constant value for os_name sent in setUserInfo.
const char kOSName[] = "ChromeOS";
diff --git a/chrome/browser/chromeos/webui/system_options_handler.cc b/chrome/browser/chromeos/webui/system_options_handler.cc
index 76ab795..027504a 100644
--- a/chrome/browser/chromeos/webui/system_options_handler.cc
+++ b/chrome/browser/chromeos/webui/system_options_handler.cc
@@ -80,7 +80,7 @@ void SystemOptionsHandler::Initialize() {
bool acc_enabled = pref_service->GetBoolean(prefs::kAccessibilityEnabled);
FundamentalValue checked(acc_enabled);
web_ui_->CallJavascriptFunction(
- L"options.SystemOptions.SetAccessibilityCheckboxState", checked);
+ "options.SystemOptions.SetAccessibilityCheckboxState", checked);
}
void SystemOptionsHandler::RegisterMessages() {
diff --git a/chrome/browser/chromeos/webui/wrench_menu_ui.cc b/chrome/browser/chromeos/webui/wrench_menu_ui.cc
index 7420bc8..db92700 100644
--- a/chrome/browser/chromeos/webui/wrench_menu_ui.cc
+++ b/chrome/browser/chromeos/webui/wrench_menu_ui.cc
@@ -101,7 +101,7 @@ void WrenchMenuUI::UpdateZoomControls() {
params.SetBoolean("minus", enable_decrement);
params.SetString("percent", l10n_util::GetStringFUTF16(
IDS_ZOOM_PERCENT, UTF8ToUTF16(base::IntToString(zoom))));
- CallJavascriptFunction(L"updateZoomControls", params);
+ CallJavascriptFunction("updateZoomControls", params);
}
views::Menu2* WrenchMenuUI::CreateMenu2(ui::MenuModel* model) {
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index f83629b..f56c732 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -283,7 +283,7 @@ void ExtensionsDOMHandler::HandleRequestExtensionsData(const ListValue* args) {
->GetBoolean(prefs::kExtensionsUIDeveloperMode);
results.SetBoolean("developerMode", developer_mode);
- web_ui_->CallJavascriptFunction(L"returnExtensionsData", results);
+ web_ui_->CallJavascriptFunction("returnExtensionsData", results);
}
void ExtensionsDOMHandler::RegisterForNotifications() {
@@ -352,7 +352,7 @@ void ExtensionsDOMHandler::HandleInspectMessage(const ListValue* args) {
}
void ExtensionsDOMHandler::HandleReloadMessage(const ListValue* args) {
- std::string extension_id = WideToASCII(ExtractStringValue(args));
+ std::string extension_id = UTF16ToASCII(ExtractStringValue(args));
CHECK(!extension_id.empty());
extensions_service_->ReloadExtension(extension_id);
}
@@ -415,7 +415,7 @@ void ExtensionsDOMHandler::HandleAllowFileAccessMessage(const ListValue* args) {
}
void ExtensionsDOMHandler::HandleUninstallMessage(const ListValue* args) {
- std::string extension_id = WideToASCII(ExtractStringValue(args));
+ std::string extension_id = UTF16ToASCII(ExtractStringValue(args));
CHECK(!extension_id.empty());
const Extension* extension =
extensions_service_->GetExtensionById(extension_id, true);
@@ -486,7 +486,7 @@ void ExtensionsDOMHandler::HandleLoadMessage(const ListValue* args) {
void ExtensionsDOMHandler::ShowAlert(const std::string& message) {
ListValue arguments;
arguments.Append(Value::CreateStringValue(message));
- web_ui_->CallJavascriptFunction(L"alert", arguments);
+ web_ui_->CallJavascriptFunction("alert", arguments);
}
void ExtensionsDOMHandler::HandlePackMessage(const ListValue* args) {
@@ -528,7 +528,7 @@ void ExtensionsDOMHandler::OnPackSuccess(const FilePath& crx_file,
pem_file)));
ListValue results;
- web_ui_->CallJavascriptFunction(L"hidePackDialog", results);
+ web_ui_->CallJavascriptFunction("hidePackDialog", results);
}
void ExtensionsDOMHandler::OnPackFailure(const std::string& error) {
@@ -587,7 +587,7 @@ void ExtensionsDOMHandler::FileSelected(const FilePath& path, int index,
// Add the extensions to the results structure.
ListValue results;
results.Append(Value::CreateStringValue(path.value()));
- web_ui_->CallJavascriptFunction(L"window.handleFilePathSelected", results);
+ web_ui_->CallJavascriptFunction("window.handleFilePathSelected", results);
}
void ExtensionsDOMHandler::MultiFilesSelected(
@@ -636,7 +636,7 @@ void ExtensionsDOMHandler::Observe(NotificationType type,
}
const Extension* ExtensionsDOMHandler::GetExtension(const ListValue* args) {
- std::string extension_id = WideToASCII(ExtractStringValue(args));
+ std::string extension_id = UTF16ToASCII(ExtractStringValue(args));
CHECK(!extension_id.empty());
return extensions_service_->GetExtensionById(extension_id, true);
}
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
index 886bdb8..75ffbe6 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
@@ -236,7 +236,7 @@ void CloudPrintSetupFlow::OnUserClickedPrintTestPage() {
// Helper methods for showing contents of the Web UI
void CloudPrintSetupFlow::ShowGaiaLogin(const DictionaryValue& args) {
if (web_ui_)
- web_ui_->CallJavascriptFunction(L"cloudprint.showSetupLogin");
+ web_ui_->CallJavascriptFunction("cloudprint.showSetupLogin");
std::string json;
base::JSONWriter::Write(&args, false, &json);
@@ -282,7 +282,7 @@ void CloudPrintSetupFlow::ShowSetupDone() {
FundamentalValue new_width(done_size.width());
FundamentalValue new_height(done_size.height());
- web_ui_->CallJavascriptFunction(L"cloudprint.showSetupDone",
+ web_ui_->CallJavascriptFunction("cloudprint.showSetupDone",
new_width, new_height);
}
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 0362a99..279ea45 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -131,17 +131,17 @@ bool GetPageSetupParameters(const std::string& json,
void CloudPrintDataSenderHelper::CallJavascriptFunction(
const std::wstring& function_name) {
- web_ui_->CallJavascriptFunction(function_name);
+ web_ui_->CallJavascriptFunction(WideToASCII(function_name));
}
void CloudPrintDataSenderHelper::CallJavascriptFunction(
const std::wstring& function_name, const Value& arg) {
- web_ui_->CallJavascriptFunction(function_name, arg);
+ web_ui_->CallJavascriptFunction(WideToASCII(function_name), arg);
}
void CloudPrintDataSenderHelper::CallJavascriptFunction(
const std::wstring& function_name, const Value& arg1, const Value& arg2) {
- web_ui_->CallJavascriptFunction(function_name, arg1, arg2);
+ web_ui_->CallJavascriptFunction(WideToASCII(function_name), arg1, arg2);
}
// Clears out the pointer we're using to communicate. Either routine is
diff --git a/chrome/browser/remoting/remoting_options_handler.cc b/chrome/browser/remoting/remoting_options_handler.cc
index e86e0a2..39bfc92 100644
--- a/chrome/browser/remoting/remoting_options_handler.cc
+++ b/chrome/browser/remoting/remoting_options_handler.cc
@@ -61,7 +61,7 @@ void RemotingOptionsHandler::SetStatus(
FundamentalValue enabled_value(enabled);
StringValue status_value(status);
- web_ui_->CallJavascriptFunction(L"options.AdvancedOptions.SetRemotingStatus",
+ web_ui_->CallJavascriptFunction("options.AdvancedOptions.SetRemotingStatus",
enabled_value, status_value);
}
diff --git a/chrome/browser/remoting/setup_flow.cc b/chrome/browser/remoting/setup_flow.cc
index 74c9540..0309d07 100644
--- a/chrome/browser/remoting/setup_flow.cc
+++ b/chrome/browser/remoting/setup_flow.cc
@@ -84,7 +84,7 @@ void SetupFlowErrorStepBase::DoStart() {
L"setMessage('" + UTF16ToWide(GetErrorMessage()) + L"');";
ExecuteJavascriptInIFrame(kErrorIframeXPath, javascript);
- flow()->web_ui()->CallJavascriptFunction(L"showError");
+ flow()->web_ui()->CallJavascriptFunction("showError");
ExecuteJavascriptInIFrame(kErrorIframeXPath, L"onPageShown();");
}
@@ -110,7 +110,7 @@ void SetupFlowDoneStep::DoStart() {
L"setMessage('" + UTF16ToWide(message_) + L"');";
ExecuteJavascriptInIFrame(kDoneIframeXPath, javascript);
- flow()->web_ui()->CallJavascriptFunction(L"showSetupDone");
+ flow()->web_ui()->CallJavascriptFunction("showSetupDone");
ExecuteJavascriptInIFrame(kDoneIframeXPath, L"onPageShown();");
}
diff --git a/chrome/browser/remoting/setup_flow_get_status_step.cc b/chrome/browser/remoting/setup_flow_get_status_step.cc
index 02e47ca..e21965c 100644
--- a/chrome/browser/remoting/setup_flow_get_status_step.cc
+++ b/chrome/browser/remoting/setup_flow_get_status_step.cc
@@ -41,7 +41,7 @@ void SetupFlowGetStatusStep::OnRemotingHostInfo(
}
void SetupFlowGetStatusStep::DoStart() {
- flow()->web_ui()->CallJavascriptFunction(L"showSettingUp");
+ flow()->web_ui()->CallJavascriptFunction("showSettingUp");
process_control_ =
ServiceProcessControlManager::GetInstance()->GetProcessControl(
diff --git a/chrome/browser/remoting/setup_flow_login_step.cc b/chrome/browser/remoting/setup_flow_login_step.cc
index e58c674..7c786b7 100644
--- a/chrome/browser/remoting/setup_flow_login_step.cc
+++ b/chrome/browser/remoting/setup_flow_login_step.cc
@@ -135,7 +135,7 @@ void SetupFlowLoginStep::ShowGaiaLogin(const DictionaryValue& args) {
WebUI* web_ui = flow()->web_ui();
DCHECK(web_ui);
- web_ui->CallJavascriptFunction(L"showLogin");
+ web_ui->CallJavascriptFunction("showLogin");
std::string json;
base::JSONWriter::Write(&args, false, &json);
diff --git a/chrome/browser/remoting/setup_flow_register_step.cc b/chrome/browser/remoting/setup_flow_register_step.cc
index a1347eee..7fb02eb 100644
--- a/chrome/browser/remoting/setup_flow_register_step.cc
+++ b/chrome/browser/remoting/setup_flow_register_step.cc
@@ -27,7 +27,7 @@ void SetupFlowRegisterStep::Cancel() {
}
void SetupFlowRegisterStep::DoStart() {
- flow()->web_ui()->CallJavascriptFunction(L"showSettingUp");
+ flow()->web_ui()->CallJavascriptFunction("showSettingUp");
request_.reset(new DirectoryAddRequest(
flow()->profile()->GetRequestContext()));
diff --git a/chrome/browser/remoting/setup_flow_start_host_step.cc b/chrome/browser/remoting/setup_flow_start_host_step.cc
index 8c53c2e..0152138 100644
--- a/chrome/browser/remoting/setup_flow_start_host_step.cc
+++ b/chrome/browser/remoting/setup_flow_start_host_step.cc
@@ -44,7 +44,7 @@ void SetupFlowStartHostStep::OnRemotingHostInfo(
}
void SetupFlowStartHostStep::DoStart() {
- flow()->web_ui()->CallJavascriptFunction(L"showSettingUp");
+ flow()->web_ui()->CallJavascriptFunction("showSettingUp");
process_control_ =
ServiceProcessControlManager::GetInstance()->GetProcessControl(
diff --git a/chrome/browser/resources/imageburner.html b/chrome/browser/resources/imageburner.html
index a90aaef..efd0c4b 100644
--- a/chrome/browser/resources/imageburner.html
+++ b/chrome/browser/resources/imageburner.html
@@ -170,7 +170,7 @@ var localStrings;
var statusMessages;
var burnStarted;
-function promtUserDownloadFinished() {
+function promptUserDownloadFinished() {
// This could be done nicer.
var answer = confirm(localStrings.getString('burnConfirmText1') +
currentlySelectedPath + localStrings.getString('burnConfirmText2'));
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index af5dacd..a102f62 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -284,7 +284,7 @@ void FlowHandler::ShowGaiaLogin(const DictionaryValue& args) {
// frame, this call would be necessary to ensure that this method actually
// shows the gaia login.
if (web_ui_)
- web_ui_->CallJavascriptFunction(L"showGaiaLoginIframe");
+ web_ui_->CallJavascriptFunction("showGaiaLoginIframe");
std::string json;
base::JSONWriter::Write(&args, false, &json);
@@ -308,7 +308,7 @@ void FlowHandler::ShowConfigure(const DictionaryValue& args) {
// "Customize Sync"), this will be redundant. However, if you're coming from
// another wizard state, this will make sure Choose Data Types is on top.
if (web_ui_)
- web_ui_->CallJavascriptFunction(L"showConfigure");
+ web_ui_->CallJavascriptFunction("showConfigure");
std::string json;
base::JSONWriter::Write(&args, false, &json);
@@ -319,7 +319,7 @@ void FlowHandler::ShowConfigure(const DictionaryValue& args) {
void FlowHandler::ShowPassphraseEntry(const DictionaryValue& args) {
if (web_ui_)
- web_ui_->CallJavascriptFunction(L"showPassphrase");
+ web_ui_->CallJavascriptFunction("showPassphrase");
std::string json;
base::JSONWriter::Write(&args, false, &json);
@@ -330,7 +330,7 @@ void FlowHandler::ShowPassphraseEntry(const DictionaryValue& args) {
void FlowHandler::ShowFirstPassphrase(const DictionaryValue& args) {
if (web_ui_)
- web_ui_->CallJavascriptFunction(L"showFirstPassphrase");
+ web_ui_->CallJavascriptFunction("showFirstPassphrase");
std::string json;
base::JSONWriter::Write(&args, false, &json);
@@ -341,7 +341,7 @@ void FlowHandler::ShowFirstPassphrase(const DictionaryValue& args) {
void FlowHandler::ShowSettingUp() {
if (web_ui_)
- web_ui_->CallJavascriptFunction(L"showSettingUp");
+ web_ui_->CallJavascriptFunction("showSettingUp");
}
void FlowHandler::ShowSetupDone(const std::wstring& user) {
@@ -354,7 +354,7 @@ void FlowHandler::ShowSetupDone(const std::wstring& user) {
ExecuteJavascriptInIFrame(kDoneIframeXPath, javascript);
if (web_ui_)
- web_ui_->CallJavascriptFunction(L"showSetupDone", synced_to_string);
+ web_ui_->CallJavascriptFunction("showSetupDone", synced_to_string);
ExecuteJavascriptInIFrame(kDoneIframeXPath,
L"onPageShown();");
diff --git a/chrome/browser/ui/views/select_file_dialog.cc b/chrome/browser/ui/views/select_file_dialog.cc
index 92652d2..bb493a8 100644
--- a/chrome/browser/ui/views/select_file_dialog.cc
+++ b/chrome/browser/ui/views/select_file_dialog.cc
@@ -475,14 +475,14 @@ void SelectFileDialogImpl::FileBrowseDelegateHandler::RegisterMessages() {
void SelectFileDialogImpl::FileBrowseDelegateHandler::HandleSetDialogTitle(
const ListValue* args) {
- std::wstring new_title = ExtractStringValue(args);
+ std::wstring new_title = UTF16ToWideHack(ExtractStringValue(args));
if (new_title != delegate_->title_) {
delegate_->title_ = new_title;
// Notify the containing view about the title change.
// The current HtmlDialogUIDelegate and HtmlDialogView does not support
// dynamic title change. We hijacked the mechanism between HTMLDialogUI
- // and HtmlDialogView to get the HtmlDialgoView and forced it to update
+ // and HtmlDialogView to get the HtmlDialogView and forced it to update
// its title.
// TODO(xiyuan): Change this when the infrastructure is improved.
HtmlDialogUIDelegate** delegate = HtmlDialogUI::GetPropertyAccessor().
diff --git a/chrome/browser/ui/views/textfield_views.cc b/chrome/browser/ui/views/textfield_views.cc
index c8fa7f5..2496663 100644
--- a/chrome/browser/ui/views/textfield_views.cc
+++ b/chrome/browser/ui/views/textfield_views.cc
@@ -20,7 +20,7 @@ void TextfieldViews::SetText(const std::wstring& text) {
TextfieldsUI* textfields_ui = web_ui();
if (textfields_ui) {
StringValue text_value(WideToUTF16(text));
- textfields_ui->CallJavascriptFunction(L"setTextfieldValue", text_value);
+ textfields_ui->CallJavascriptFunction("setTextfieldValue", text_value);
}
SchedulePaint();
}
diff --git a/chrome/browser/ui/webui/app_launcher_handler.cc b/chrome/browser/ui/webui/app_launcher_handler.cc
index d2f1412..afbd318 100644
--- a/chrome/browser/ui/webui/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/app_launcher_handler.cc
@@ -198,7 +198,7 @@ void AppLauncherHandler::Observe(NotificationType type,
DictionaryValue dictionary;
FillAppDictionary(&dictionary);
- web_ui_->CallJavascriptFunction(L"appsPrefChangeCallback", dictionary);
+ web_ui_->CallJavascriptFunction("appsPrefChangeCallback", dictionary);
break;
}
default:
@@ -279,7 +279,7 @@ void AppLauncherHandler::HandleGetApps(const ListValue* args) {
}
FillAppDictionary(&dictionary);
- web_ui_->CallJavascriptFunction(L"getAppsCallback", dictionary);
+ web_ui_->CallJavascriptFunction("getAppsCallback", dictionary);
// First time we get here we set up the observer so that we can tell update
// the apps as they change.
@@ -392,7 +392,7 @@ void AppLauncherHandler::HandleSetLaunchType(const ListValue* args) {
}
void AppLauncherHandler::HandleUninstallApp(const ListValue* args) {
- std::string extension_id = WideToUTF8(ExtractStringValue(args));
+ std::string extension_id = UTF16ToUTF8(ExtractStringValue(args));
const Extension* extension = extensions_service_->GetExtensionById(
extension_id, false);
if (!extension)
@@ -550,7 +550,7 @@ void AppLauncherHandler::InstallUIProceed() {
// icon disappears but isn't replaced by the enabled icon, making a poor
// visual experience.
StringValue* app_id = Value::CreateStringValue(extension->id());
- web_ui_->CallJavascriptFunction(L"launchAppAfterEnable", *app_id);
+ web_ui_->CallJavascriptFunction("launchAppAfterEnable", *app_id);
break;
}
default:
diff --git a/chrome/browser/ui/webui/bug_report_ui.cc b/chrome/browser/ui/webui/bug_report_ui.cc
index 1b459bf..41464c4 100644
--- a/chrome/browser/ui/webui/bug_report_ui.cc
+++ b/chrome/browser/ui/webui/bug_report_ui.cc
@@ -562,13 +562,13 @@ void BugReportHandler::HandleGetDialogDefaults(const ListValue*) {
dialog_defaults.Append(new StringValue(GetUserEmail()));
#endif
- web_ui_->CallJavascriptFunction(L"setupDialogDefaults", dialog_defaults);
+ web_ui_->CallJavascriptFunction("setupDialogDefaults", dialog_defaults);
}
void BugReportHandler::HandleRefreshCurrentScreenshot(const ListValue*) {
std::string current_screenshot(kCurrentScreenshotUrl);
StringValue screenshot(current_screenshot);
- web_ui_->CallJavascriptFunction(L"setupCurrentScreenshot", screenshot);
+ web_ui_->CallJavascriptFunction("setupCurrentScreenshot", screenshot);
}
@@ -580,7 +580,7 @@ void BugReportHandler::HandleRefreshSavedScreenshots(const ListValue*) {
ListValue screenshots_list;
for (size_t i = 0; i < saved_screenshots.size(); ++i)
screenshots_list.Append(new StringValue(saved_screenshots[i]));
- web_ui_->CallJavascriptFunction(L"setupSavedScreenshots", screenshots_list);
+ web_ui_->CallJavascriptFunction("setupSavedScreenshots", screenshots_list);
}
#endif
diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc
index 58955e1..fdb3fe2 100644
--- a/chrome/browser/ui/webui/conflicts_ui.cc
+++ b/chrome/browser/ui/webui/conflicts_ui.cc
@@ -169,7 +169,7 @@ void ConflictsDOMHandler::SendModuleList() {
}
results.SetString("modulesTableTitle", table_title);
- web_ui_->CallJavascriptFunction(L"returnModuleList", results);
+ web_ui_->CallJavascriptFunction("returnModuleList", results);
}
void ConflictsDOMHandler::Observe(NotificationType type,
diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc
index 60093b0..2706f7a 100644
--- a/chrome/browser/ui/webui/crashes_ui.cc
+++ b/chrome/browser/ui/webui/crashes_ui.cc
@@ -177,7 +177,7 @@ void CrashesDOMHandler::UpdateUI() {
FundamentalValue enabled(crash_reporting_enabled);
- web_ui_->CallJavascriptFunction(L"updateCrashList", enabled, crash_list);
+ web_ui_->CallJavascriptFunction("updateCrashList", enabled, crash_list);
}
bool CrashesDOMHandler::CrashReportingEnabled() const {
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index 272227f..b05c802 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -108,7 +108,7 @@ void DownloadsDOMHandler::OnDownloadUpdated(DownloadItem* download) {
ListValue results_value;
results_value.Append(download_util::CreateDownloadItemValue(download, id));
- web_ui_->CallJavascriptFunction(L"downloadUpdated", results_value);
+ web_ui_->CallJavascriptFunction("downloadUpdated", results_value);
}
// A download has started or been deleted. Query our DownloadManager for the
@@ -139,7 +139,7 @@ void DownloadsDOMHandler::ModelChanged() {
}
void DownloadsDOMHandler::HandleGetDownloads(const ListValue* args) {
- std::wstring new_search = ExtractStringValue(args);
+ std::wstring new_search = UTF16ToWideHack(ExtractStringValue(args));
if (search_text_.compare(new_search) != 0) {
search_text_ = new_search;
ModelChanged();
@@ -217,7 +217,7 @@ void DownloadsDOMHandler::SendCurrentDownloads() {
results_value.Append(download_util::CreateDownloadItemValue(*it, index));
}
- web_ui_->CallJavascriptFunction(L"downloadsList", results_value);
+ web_ui_->CallJavascriptFunction("downloadsList", results_value);
}
void DownloadsDOMHandler::ClearDownloadItems() {
diff --git a/chrome/browser/ui/webui/file_browse_browsertest.cc b/chrome/browser/ui/webui/file_browse_browsertest.cc
index 7bb8c13..fe1c3a3 100644
--- a/chrome/browser/ui/webui/file_browse_browsertest.cc
+++ b/chrome/browser/ui/webui/file_browse_browsertest.cc
@@ -122,7 +122,7 @@ IN_PROC_BROWSER_TEST_F(FileBrowseBrowserTest, InputFileTriggerFileBrowse) {
WebUI* file_browser_ui = observer.file_browse_ui();
ASSERT_TRUE(file_browser_ui);
- file_browser_ui->CallJavascriptFunction(L"dialogCancelClick");
+ file_browser_ui->CallJavascriptFunction("dialogCancelClick");
observer.WaitForFileBrowseClose();
}
diff --git a/chrome/browser/ui/webui/filebrowse_ui.cc b/chrome/browser/ui/webui/filebrowse_ui.cc
index 2ab22bc..5020cd1 100644
--- a/chrome/browser/ui/webui/filebrowse_ui.cc
+++ b/chrome/browser/ui/webui/filebrowse_ui.cc
@@ -548,7 +548,7 @@ void FilebrowseHandler::FireUploadComplete() {
picture_url += kPicasawebDropBox;
info_value.SetString("url", picture_url);
info_value.SetInteger("status_code", upload_response_code_);
- web_ui_->CallJavascriptFunction(L"uploadComplete", info_value);
+ web_ui_->CallJavascriptFunction("uploadComplete", info_value);
#endif
}
@@ -558,7 +558,7 @@ void FilebrowseHandler::MountChanged(chromeos::MountLibrary* obj,
const std::string& path) {
if (evt == chromeos::DISK_REMOVED ||
evt == chromeos::DISK_CHANGED) {
- web_ui_->CallJavascriptFunction(L"rootsChanged");
+ web_ui_->CallJavascriptFunction("rootsChanged");
}
}
#endif
@@ -623,13 +623,13 @@ void FilebrowseHandler::HandleGetRoots(const ListValue* args) {
info_value.SetString("functionCall", "getRoots");
info_value.SetString(kPropertyPath, "");
- web_ui_->CallJavascriptFunction(L"browseFileResult",
+ web_ui_->CallJavascriptFunction("browseFileResult",
info_value, results_value);
}
void FilebrowseHandler::HandleCreateNewFolder(const ListValue* args) {
#if defined(OS_CHROMEOS)
- std::string path = WideToUTF8(ExtractStringValue(args));
+ std::string path = UTF16ToUTF8(ExtractStringValue(args));
FilePath currentpath(path);
scoped_refptr<TaskProxy> task = new TaskProxy(AsWeakPtr(), currentpath);
@@ -648,7 +648,7 @@ void FilebrowseHandler::CreateNewFolder(const FilePath& currentpath) const {
void FilebrowseHandler::PlayMediaFile(const ListValue* args) {
#if defined(OS_CHROMEOS)
- std::string url = WideToUTF8(ExtractStringValue(args));
+ std::string url = UTF16ToUTF8(ExtractStringValue(args));
GURL gurl(url);
Browser* browser = Browser::GetBrowserForController(
@@ -660,7 +660,7 @@ void FilebrowseHandler::PlayMediaFile(const ListValue* args) {
void FilebrowseHandler::EnqueueMediaFile(const ListValue* args) {
#if defined(OS_CHROMEOS)
- std::string url = WideToUTF8(ExtractStringValue(args));
+ std::string url = UTF16ToUTF8(ExtractStringValue(args));
GURL gurl(url);
Browser* browser = Browser::GetBrowserForController(
@@ -679,7 +679,7 @@ void FilebrowseHandler::HandleIsAdvancedEnabled(const ListValue* args) {
DictionaryValue info_value;
info_value.SetBoolean("enabled", is_enabled);
info_value.SetBoolean("mpEnabled", mp_enabled);
- web_ui_->CallJavascriptFunction(L"enabledResult",
+ web_ui_->CallJavascriptFunction("enabledResult",
info_value);
#endif
@@ -687,7 +687,7 @@ void FilebrowseHandler::HandleIsAdvancedEnabled(const ListValue* args) {
void FilebrowseHandler::HandleRefreshDirectory(const ListValue* args) {
#if defined(OS_CHROMEOS)
- std::string path = WideToUTF8(ExtractStringValue(args));
+ std::string path = UTF16ToUTF8(ExtractStringValue(args));
FilePath currentpath(path);
GetChildrenForPath(currentpath, true);
#endif
@@ -743,7 +743,7 @@ void FilebrowseHandler::OpenNewPopupWindow(const ListValue* args) {
}
void FilebrowseHandler::OpenNewWindow(const ListValue* args, bool popup) {
- std::string url = WideToUTF8(ExtractStringValue(args));
+ std::string url = UTF16ToUTF8(ExtractStringValue(args));
Browser* browser = popup ?
Browser::CreateForType(Browser::TYPE_APP_PANEL, profile_) :
BrowserList::GetLastActive();
@@ -819,7 +819,7 @@ void FilebrowseHandler::ReadInFile() {
// TODO(dhg): Remove this and implement general upload.
void FilebrowseHandler::UploadToPicasaweb(const ListValue* args) {
#if defined(OS_CHROMEOS)
- std::string search_string = WideToUTF8(ExtractStringValue(args));
+ std::string search_string = UTF16ToUTF8(ExtractStringValue(args));
current_file_uploaded_ = search_string;
// ReadInFile();
FilePath current_path(search_string);
@@ -873,7 +873,7 @@ void FilebrowseHandler::GetChildrenForPath(const FilePath& path,
void FilebrowseHandler::HandleGetChildren(const ListValue* args) {
#if defined(OS_CHROMEOS)
- std::string path = WideToUTF8(ExtractStringValue(args));
+ std::string path = UTF16ToUTF8(ExtractStringValue(args));
FilePath currentpath(path);
filelist_value_.reset(new ListValue());
@@ -928,7 +928,7 @@ void FilebrowseHandler::OnListDone(int error) {
info_value.SetString("functionCall", "getChildren");
}
info_value.SetString(kPropertyPath, currentpath_.value());
- web_ui_->CallJavascriptFunction(L"browseFileResult",
+ web_ui_->CallJavascriptFunction("browseFileResult",
info_value, *(filelist_value_.get()));
}
@@ -980,7 +980,7 @@ void FilebrowseHandler::UpdateDownloadList() {
void FilebrowseHandler::SendNewDownload(DownloadItem* download) {
ListValue results_value;
results_value.Append(download_util::CreateDownloadItemValue(download, -1));
- web_ui_->CallJavascriptFunction(L"newDownload", results_value);
+ web_ui_->CallJavascriptFunction("newDownload", results_value);
}
void FilebrowseHandler::DeleteFile(const FilePath& path, TaskProxy* task) {
@@ -1011,7 +1011,7 @@ void FilebrowseHandler::CopyFile(const FilePath& src,
void FilebrowseHandler::HandleDeleteFile(const ListValue* args) {
#if defined(OS_CHROMEOS)
- std::string path = WideToUTF8(ExtractStringValue(args));
+ std::string path = UTF16ToUTF8(ExtractStringValue(args));
FilePath currentpath(path);
// Don't allow file deletion in inaccessible dirs.
@@ -1128,7 +1128,7 @@ void FilebrowseHandler::FireOnValidatedSavePathOnUIThread(bool valid,
FundamentalValue valid_value(valid);
StringValue path_value(save_path.value());
- web_ui_->CallJavascriptFunction(L"onValidatedSavePath",
+ web_ui_->CallJavascriptFunction("onValidatedSavePath",
valid_value, path_value);
}
@@ -1142,7 +1142,7 @@ void FilebrowseHandler::OnDownloadUpdated(DownloadItem* download) {
scoped_ptr<DictionaryValue> download_item(
download_util::CreateDownloadItemValue(download, id));
- web_ui_->CallJavascriptFunction(L"downloadUpdated", *download_item.get());
+ web_ui_->CallJavascriptFunction("downloadUpdated", *download_item.get());
}
void FilebrowseHandler::ClearDownloadItems() {
@@ -1161,7 +1161,7 @@ void FilebrowseHandler::SendCurrentDownloads() {
results_value.Append(download_util::CreateDownloadItemValue(*it, index));
}
- web_ui_->CallJavascriptFunction(L"downloadsList", results_value);
+ web_ui_->CallJavascriptFunction("downloadsList", results_value);
}
void FilebrowseHandler::OnDownloadFileCompleted(DownloadItem* download) {
diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc
index a196f83..d2d39af 100644
--- a/chrome/browser/ui/webui/flags_ui.cc
+++ b/chrome/browser/ui/webui/flags_ui.cc
@@ -140,7 +140,7 @@ void FlagsDOMHandler::HandleRequestFlagsExperiments(const ListValue* args) {
g_browser_process->local_state()));
results.SetBoolean("needsRestart",
about_flags::IsRestartNeededToCommitChanges());
- web_ui_->CallJavascriptFunction(L"returnFlagsExperiments", results);
+ web_ui_->CallJavascriptFunction("returnFlagsExperiments", results);
}
void FlagsDOMHandler::HandleEnableFlagsExperimentMessage(
diff --git a/chrome/browser/ui/webui/foreign_session_handler.cc b/chrome/browser/ui/webui/foreign_session_handler.cc
index 5916814..2e62d2e 100644
--- a/chrome/browser/ui/webui/foreign_session_handler.cc
+++ b/chrome/browser/ui/webui/foreign_session_handler.cc
@@ -62,7 +62,7 @@ void ForeignSessionHandler::Observe(NotificationType type,
case NotificationType::FOREIGN_SESSION_DISABLED:
// Calling foreignSessions with empty list will automatically hide
// foreign session section.
- web_ui_->CallJavascriptFunction(L"foreignSessions", list_value);
+ web_ui_->CallJavascriptFunction("foreignSessions", list_value);
break;
default:
NOTREACHED();
@@ -122,10 +122,10 @@ void ForeignSessionHandler::HandleGetForeignSessions(const ListValue* args) {
}
added_count++;
- // Give ownership to |session_list|
+ // Give ownership to |session_list|.
session_list.Append(window_list.release());
}
- web_ui_->CallJavascriptFunction(L"foreignSessions", session_list);
+ web_ui_->CallJavascriptFunction("foreignSessions", session_list);
}
void ForeignSessionHandler::HandleOpenForeignSession(
@@ -137,7 +137,7 @@ void ForeignSessionHandler::HandleOpenForeignSession(
return;
}
- // Extract the machine tag (always provided)
+ // Extract the machine tag (always provided).
std::string session_string_value;
if (!args->GetString(0, &session_string_value)) {
LOG(ERROR) << "Failed to extract session tag.";
diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc
index b7cd155..e8d6d3b 100644
--- a/chrome/browser/ui/webui/gpu_internals_ui.cc
+++ b/chrome/browser/ui/webui/gpu_internals_ui.cc
@@ -208,12 +208,12 @@ void GpuMessageHandler::OnCallAsync(const ListValue* args) {
// call BrowserBridge.onCallAsyncReply with result
if (ret) {
- web_ui_->CallJavascriptFunction(L"browserBridge.onCallAsyncReply",
+ web_ui_->CallJavascriptFunction("browserBridge.onCallAsyncReply",
*requestId,
*ret);
delete ret;
} else {
- web_ui_->CallJavascriptFunction(L"browserBridge.onCallAsyncReply",
+ web_ui_->CallJavascriptFunction("browserBridge.onCallAsyncReply",
*requestId);
}
}
@@ -373,7 +373,7 @@ void GpuMessageHandler::OnGpuInfoUpdate() {
// Send GPU Info to javascript.
- web_ui_->CallJavascriptFunction(L"browserBridge.onGpuInfoUpdate",
+ web_ui_->CallJavascriptFunction("browserBridge.onGpuInfoUpdate",
*gpu_info_val);
delete gpu_info_val;
diff --git a/chrome/browser/ui/webui/history2_ui.cc b/chrome/browser/ui/webui/history2_ui.cc
index afca181..5b253f8 100644
--- a/chrome/browser/ui/webui/history2_ui.cc
+++ b/chrome/browser/ui/webui/history2_ui.cc
@@ -203,7 +203,7 @@ void BrowsingHistoryHandler2::HandleSearchHistory(const ListValue* args) {
void BrowsingHistoryHandler2::HandleRemoveURLsOnOneDay(const ListValue* args) {
if (cancelable_delete_consumer_.HasPendingRequests()) {
- web_ui_->CallJavascriptFunction(L"deleteFailed");
+ web_ui_->CallJavascriptFunction("deleteFailed");
return;
}
@@ -296,12 +296,12 @@ void BrowsingHistoryHandler2::QueryComplete(
info_value.SetString("term", search_text_);
info_value.SetBoolean("finished", results->reached_beginning());
- web_ui_->CallJavascriptFunction(L"historyResult", info_value, results_value);
+ web_ui_->CallJavascriptFunction("historyResult", info_value, results_value);
}
void BrowsingHistoryHandler2::RemoveComplete() {
// Some Visits were deleted from history. Reload the list.
- web_ui_->CallJavascriptFunction(L"deleteComplete");
+ web_ui_->CallJavascriptFunction("deleteComplete");
}
void BrowsingHistoryHandler2::ExtractSearchHistoryArguments(
@@ -382,7 +382,7 @@ void BrowsingHistoryHandler2::Observe(NotificationType type,
}
// Some URLs were deleted from history. Reload the list.
- web_ui_->CallJavascriptFunction(L"historyDeleted");
+ web_ui_->CallJavascriptFunction("historyDeleted");
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index f380988..8f30902 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -203,7 +203,7 @@ void BrowsingHistoryHandler::HandleSearchHistory(const ListValue* args) {
void BrowsingHistoryHandler::HandleRemoveURLsOnOneDay(const ListValue* args) {
if (cancelable_delete_consumer_.HasPendingRequests()) {
- web_ui_->CallJavascriptFunction(L"deleteFailed");
+ web_ui_->CallJavascriptFunction("deleteFailed");
return;
}
@@ -296,12 +296,12 @@ void BrowsingHistoryHandler::QueryComplete(
info_value.SetString("term", search_text_);
info_value.SetBoolean("finished", results->reached_beginning());
- web_ui_->CallJavascriptFunction(L"historyResult", info_value, results_value);
+ web_ui_->CallJavascriptFunction("historyResult", info_value, results_value);
}
void BrowsingHistoryHandler::RemoveComplete() {
// Some Visits were deleted from history. Reload the list.
- web_ui_->CallJavascriptFunction(L"deleteComplete");
+ web_ui_->CallJavascriptFunction("deleteComplete");
}
void BrowsingHistoryHandler::ExtractSearchHistoryArguments(
@@ -370,7 +370,7 @@ void BrowsingHistoryHandler::Observe(NotificationType type,
}
// Some URLs were deleted from history. Reload the list.
- web_ui_->CallJavascriptFunction(L"historyDeleted");
+ web_ui_->CallJavascriptFunction("historyDeleted");
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/webui/mediaplayer_ui.cc b/chrome/browser/ui/webui/mediaplayer_ui.cc
index 7fceacc..2b6aa78 100644
--- a/chrome/browser/ui/webui/mediaplayer_ui.cc
+++ b/chrome/browser/ui/webui/mediaplayer_ui.cc
@@ -285,7 +285,7 @@ void MediaplayerHandler::FirePlaylistChanged(const std::string& path,
info_value.SetString(kPropertyPath, path);
info_value.SetBoolean(kPropertyForce, force);
info_value.SetInteger(kPropertyOffset, offset);
- web_ui_->CallJavascriptFunction(L"playlistChanged", info_value, urls);
+ web_ui_->CallJavascriptFunction("playlistChanged", info_value, urls);
}
void MediaplayerHandler::SetCurrentPlaylistOffset(int offset) {
diff --git a/chrome/browser/ui/webui/most_visited_handler.cc b/chrome/browser/ui/webui/most_visited_handler.cc
index e1b966d..a12ea0a 100644
--- a/chrome/browser/ui/webui/most_visited_handler.cc
+++ b/chrome/browser/ui/webui/most_visited_handler.cc
@@ -127,7 +127,7 @@ void MostVisitedHandler::SendPagesValue() {
has_blacklisted_urls = ts->HasBlacklistedItems();
FundamentalValue first_run(IsFirstRun());
FundamentalValue has_blacklisted_urls_value(has_blacklisted_urls);
- web_ui_->CallJavascriptFunction(L"mostVisitedPages",
+ web_ui_->CallJavascriptFunction("mostVisitedPages",
*(pages_value_.get()),
first_run,
has_blacklisted_urls_value);
@@ -146,7 +146,7 @@ void MostVisitedHandler::StartQueryForMostVisited() {
}
void MostVisitedHandler::HandleBlacklistURL(const ListValue* args) {
- std::string url = WideToUTF8(ExtractStringValue(args));
+ std::string url = UTF16ToUTF8(ExtractStringValue(args));
BlacklistURL(GURL(url));
}
@@ -219,7 +219,7 @@ void MostVisitedHandler::AddPinnedURL(const MostVisitedPage& page, int index) {
}
void MostVisitedHandler::HandleRemovePinnedURL(const ListValue* args) {
- std::string url = WideToUTF8(ExtractStringValue(args));
+ std::string url = UTF16ToUTF8(ExtractStringValue(args));
RemovePinnedURL(GURL(url));
}
diff --git a/chrome/browser/ui/webui/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals_ui.cc
index b36d122..a440a39 100644
--- a/chrome/browser/ui/webui/net_internals_ui.cc
+++ b/chrome/browser/ui/webui/net_internals_ui.cc
@@ -553,9 +553,9 @@ void NetInternalsMessageHandler::CallJavascriptFunction(
const Value* value) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (value) {
- web_ui_->CallJavascriptFunction(function_name, *value);
+ web_ui_->CallJavascriptFunction(WideToASCII(function_name), *value);
} else {
- web_ui_->CallJavascriptFunction(function_name);
+ web_ui_->CallJavascriptFunction(WideToASCII(function_name));
}
}
diff --git a/chrome/browser/ui/webui/new_tab_page_sync_handler.cc b/chrome/browser/ui/webui/new_tab_page_sync_handler.cc
index 8e6468f..3dbc65a 100644
--- a/chrome/browser/ui/webui/new_tab_page_sync_handler.cc
+++ b/chrome/browser/ui/webui/new_tab_page_sync_handler.cc
@@ -161,7 +161,7 @@ void NewTabPageSyncHandler::HandleSyncLinkClicked(const ListValue* args) {
value.SetString("syncEnabledMessage",
l10n_util::GetStringFUTF16(IDS_SYNC_NTP_SYNCED_TO,
sync_service_->GetAuthenticatedUsername()));
- web_ui_->CallJavascriptFunction(L"syncAlreadyEnabled", value);
+ web_ui_->CallJavascriptFunction("syncAlreadyEnabled", value);
} else {
// User clicked the 'Start now' link to begin syncing.
ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_NTP);
@@ -216,5 +216,5 @@ void NewTabPageSyncHandler::SendSyncMessageToPage(
}
}
}
- web_ui_->CallJavascriptFunction(L"syncMessageChanged", value);
+ web_ui_->CallJavascriptFunction("syncMessageChanged", value);
}
diff --git a/chrome/browser/ui/webui/new_tab_ui.cc b/chrome/browser/ui/webui/new_tab_ui.cc
index 5df0522..25ca83d 100644
--- a/chrome/browser/ui/webui/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/new_tab_ui.cc
@@ -151,7 +151,7 @@ void RecentlyClosedTabsHandler::TabRestoreServiceChanged(
ListValue list_value;
NewTabUI::AddRecentlyClosedEntries(service->entries(), &list_value);
- web_ui_->CallJavascriptFunction(L"recentlyClosedTabs", list_value);
+ web_ui_->CallJavascriptFunction("recentlyClosedTabs", list_value);
}
void RecentlyClosedTabsHandler::TabRestoreServiceDestroyed(
@@ -196,12 +196,12 @@ void MetricsHandler::RegisterMessages() {
}
void MetricsHandler::HandleMetrics(const ListValue* args) {
- std::string string_action = WideToUTF8(ExtractStringValue(args));
+ std::string string_action = UTF16ToUTF8(ExtractStringValue(args));
UserMetrics::RecordComputedAction(string_action, web_ui_->GetProfile());
}
void MetricsHandler::HandleLogEventTime(const ListValue* args) {
- std::string event_name = WideToUTF8(ExtractStringValue(args));
+ std::string event_name = UTF16ToUTF8(ExtractStringValue(args));
web_ui_->tab_contents()->LogNewTabTime(event_name);
}
@@ -240,7 +240,7 @@ void NewTabPageSetHomePageHandler::HandleSetHomePage(
l10n_util::GetStringUTF16(IDS_NEW_TAB_HOME_PAGE_SET_NOTIFICATION)));
list_value.Append(new StringValue(
l10n_util::GetStringUTF16(IDS_NEW_TAB_HOME_PAGE_HIDE_NOTIFICATION)));
- web_ui_->CallJavascriptFunction(L"onHomePageSet", list_value);
+ web_ui_->CallJavascriptFunction("onHomePageSet", list_value);
}
///////////////////////////////////////////////////////////////////////////////
@@ -397,14 +397,14 @@ void NewTabUI::Observe(NotificationType type,
GetProfile()->GetThemeProvider()->HasCustomImage(
IDR_THEME_NTP_ATTRIBUTION) ?
"true" : "false"));
- CallJavascriptFunction(L"themeChanged", args);
+ CallJavascriptFunction("themeChanged", args);
break;
}
case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: {
if (GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar))
- CallJavascriptFunction(L"bookmarkBarAttached");
+ CallJavascriptFunction("bookmarkBarAttached");
else
- CallJavascriptFunction(L"bookmarkBarDetached");
+ CallJavascriptFunction("bookmarkBarDetached");
break;
}
case NotificationType::RENDER_WIDGET_HOST_DID_PAINT: {
diff --git a/chrome/browser/ui/webui/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp_login_handler.cc
index beea8a1..1d6a13c 100644
--- a/chrome/browser/ui/webui/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp_login_handler.cc
@@ -51,5 +51,5 @@ void NTPLoginHandler::UpdateLogin() {
std::string username = web_ui_->GetProfile()->GetPrefs()->GetString(
prefs::kGoogleServicesUsername);
StringValue string_value(username);
- web_ui_->CallJavascriptFunction(L"updateLogin", string_value);
+ web_ui_->CallJavascriptFunction("updateLogin", string_value);
}
diff --git a/chrome/browser/ui/webui/options/about_page_handler.cc b/chrome/browser/ui/webui/options/about_page_handler.cc
index 7e96e51..9f6f1a4 100644
--- a/chrome/browser/ui/webui/options/about_page_handler.cc
+++ b/chrome/browser/ui/webui/options/about_page_handler.cc
@@ -280,7 +280,7 @@ void AboutPageHandler::PageReady(const ListValue* args) {
// Update the channel information.
std::string channel = update_library->GetReleaseTrack();
scoped_ptr<Value> channel_string(Value::CreateStringValue(channel));
- web_ui_->CallJavascriptFunction(L"AboutPage.updateSelectedOptionCallback",
+ web_ui_->CallJavascriptFunction("AboutPage.updateSelectedOptionCallback",
*channel_string);
update_observer_.reset(new UpdateObserver(this));
@@ -303,7 +303,7 @@ void AboutPageHandler::SetReleaseTrack(const ListValue* args) {
LOG(WARNING) << "Non-owner tried to change release track.";
return;
}
- const std::string channel = WideToUTF8(ExtractStringValue(args));
+ const std::string channel = UTF16ToUTF8(ExtractStringValue(args));
chromeos::CrosLibrary::Get()->GetUpdateLibrary()->SetReleaseTrack(channel);
#endif
}
@@ -390,20 +390,20 @@ void AboutPageHandler::UpdateStatus(
// can read it, hence insert delay for this.
scoped_ptr<Value> insert_delay(Value::CreateBooleanValue(
status.status == chromeos::UPDATE_STATUS_CHECKING_FOR_UPDATE));
- web_ui_->CallJavascriptFunction(L"AboutPage.updateStatusCallback",
+ web_ui_->CallJavascriptFunction("AboutPage.updateStatusCallback",
*update_message, *insert_delay);
scoped_ptr<Value> enabled_value(Value::CreateBooleanValue(enabled));
- web_ui_->CallJavascriptFunction(L"AboutPage.updateEnableCallback",
+ web_ui_->CallJavascriptFunction("AboutPage.updateEnableCallback",
*enabled_value);
scoped_ptr<Value> image_string(Value::CreateStringValue(image));
- web_ui_->CallJavascriptFunction(L"AboutPage.setUpdateImage",
+ web_ui_->CallJavascriptFunction("AboutPage.setUpdateImage",
*image_string);
}
// We'll change the "Check For Update" button to "Restart" button.
if (status.status == chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) {
- web_ui_->CallJavascriptFunction(L"AboutPage.changeToRestartButton");
+ web_ui_->CallJavascriptFunction("AboutPage.changeToRestartButton");
}
}
@@ -411,7 +411,7 @@ void AboutPageHandler::OnOSVersion(chromeos::VersionLoader::Handle handle,
std::string version) {
if (version.size()) {
scoped_ptr<Value> version_string(Value::CreateStringValue(version));
- web_ui_->CallJavascriptFunction(L"AboutPage.updateOSVersionCallback",
+ web_ui_->CallJavascriptFunction("AboutPage.updateOSVersionCallback",
*version_string);
}
}
diff --git a/chrome/browser/ui/webui/options/add_startup_page_handler.cc b/chrome/browser/ui/webui/options/add_startup_page_handler.cc
index 9bd8efb..aff0cbe 100644
--- a/chrome/browser/ui/webui/options/add_startup_page_handler.cc
+++ b/chrome/browser/ui/webui/options/add_startup_page_handler.cc
@@ -66,7 +66,7 @@ void AddStartupPageHandler::UpdateFieldWithRecentPage(const ListValue* args) {
UnescapeRule::SPACES, NULL, NULL, NULL);
scoped_ptr<Value> url_value(Value::CreateStringValue(url_string));
- web_ui_->CallJavascriptFunction(L"AddStartupPageOverlay.setInputFieldValue",
+ web_ui_->CallJavascriptFunction("AddStartupPageOverlay.setInputFieldValue",
*url_value.get());
}
@@ -81,7 +81,7 @@ void AddStartupPageHandler::OnModelChanged() {
pages.Append(dict);
}
- web_ui_->CallJavascriptFunction(L"AddStartupPageOverlay.updateRecentPageList",
+ web_ui_->CallJavascriptFunction("AddStartupPageOverlay.updateRecentPageList",
pages);
}
diff --git a/chrome/browser/ui/webui/options/advanced_options_handler.cc b/chrome/browser/ui/webui/options/advanced_options_handler.cc
index 8094389..35b5bcae 100644
--- a/chrome/browser/ui/webui/options/advanced_options_handler.cc
+++ b/chrome/browser/ui/webui/options/advanced_options_handler.cc
@@ -353,7 +353,7 @@ void AdvancedOptionsHandler::HandleSelectDownloadLocation(
void AdvancedOptionsHandler::HandlePromptForDownload(
const ListValue* args) {
- std::string checked_str = WideToUTF8(ExtractStringValue(args));
+ std::string checked_str = UTF16ToUTF8(ExtractStringValue(args));
ask_for_save_location_.SetValue(checked_str == "true");
}
@@ -515,13 +515,13 @@ void AdvancedOptionsHandler::SetupCloudPrintProxySection() {
StringValue label(label_str);
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetupCloudPrintProxySection",
+ "options.AdvancedOptions.SetupCloudPrintProxySection",
disabled, label, allowed);
}
void AdvancedOptionsHandler::RemoveCloudPrintProxySection() {
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.RemoveCloudPrintProxySection");
+ "options.AdvancedOptions.RemoveCloudPrintProxySection");
}
#endif
@@ -529,7 +529,7 @@ void AdvancedOptionsHandler::RemoveCloudPrintProxySection() {
#if defined(ENABLE_REMOTING) && !defined(OS_CHROMEOS)
void AdvancedOptionsHandler::RemoveRemotingSection() {
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.RemoveRemotingSection");
+ "options.AdvancedOptions.RemoveRemotingSection");
}
void AdvancedOptionsHandler::ShowRemotingSetupDialog(const ListValue* args) {
@@ -551,7 +551,7 @@ void AdvancedOptionsHandler::SetupMetricsReportingCheckbox() {
FundamentalValue checked(enable_metrics_recording_.GetValue());
FundamentalValue disabled(enable_metrics_recording_.IsManaged());
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetMetricsReportingCheckboxState", checked,
+ "options.AdvancedOptions.SetMetricsReportingCheckboxState", checked,
disabled);
#endif
}
@@ -562,7 +562,7 @@ void AdvancedOptionsHandler::SetupMetricsReportingSettingVisibility() {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) {
FundamentalValue visible(false);
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetMetricsReportingSettingVisibility",
+ "options.AdvancedOptions.SetMetricsReportingSettingVisibility",
visible);
}
#endif
@@ -573,22 +573,21 @@ void AdvancedOptionsHandler::SetupFontSizeLabel() {
FundamentalValue fixed_font_size(default_fixed_font_size_.GetValue());
FundamentalValue font_size(default_font_size_.GetValue());
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetFontSize", fixed_font_size,
- font_size);
+ "options.AdvancedOptions.SetFontSize", fixed_font_size, font_size);
}
void AdvancedOptionsHandler::SetupDownloadLocationPath() {
StringValue value(default_download_location_.GetValue().value());
FundamentalValue disabled(default_download_location_.IsManaged());
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetDownloadLocationPath", value, disabled);
+ "options.AdvancedOptions.SetDownloadLocationPath", value, disabled);
}
void AdvancedOptionsHandler::SetupPromptForDownload() {
FundamentalValue checked(ask_for_save_location_.GetValue());
FundamentalValue disabled(default_download_location_.IsManaged());
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetPromptForDownload", checked, disabled);
+ "options.AdvancedOptions.SetPromptForDownload", checked, disabled);
}
void AdvancedOptionsHandler::SetupAutoOpenFileTypesDisabledAttribute() {
@@ -598,7 +597,7 @@ void AdvancedOptionsHandler::SetupAutoOpenFileTypesDisabledAttribute() {
bool disabled = !(manager && manager->download_prefs()->IsAutoOpenUsed());
FundamentalValue value(disabled);
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute", value);
+ "options.AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute", value);
}
void AdvancedOptionsHandler::SetupProxySettingsSection() {
@@ -624,7 +623,7 @@ void AdvancedOptionsHandler::SetupProxySettingsSection() {
StringValue label(label_str);
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetupProxySettingsSection", disabled, label);
+ "options.AdvancedOptions.SetupProxySettingsSection", disabled, label);
}
#if defined(OS_WIN)
@@ -645,15 +644,15 @@ void AdvancedOptionsHandler::SetupSSLConfigSettings() {
FundamentalValue disabledValue(disabled);
FundamentalValue checkRevocationValue(checkRevocationSetting);
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetCheckRevocationCheckboxState",
+ "options.AdvancedOptions.SetCheckRevocationCheckboxState",
checkRevocationValue, disabledValue);
FundamentalValue useSSL3Value(useSSL3Setting);
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetUseSSL3CheckboxState",
+ "options.AdvancedOptions.SetUseSSL3CheckboxState",
useSSL3Value, disabledValue);
FundamentalValue useTLS1Value(useTLS1Setting);
web_ui_->CallJavascriptFunction(
- L"options.AdvancedOptions.SetUseTLS1CheckboxState",
+ "options.AdvancedOptions.SetUseTLS1CheckboxState",
useTLS1Value, disabledValue);
}
#endif
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc
index 5672e12..c48338c 100644
--- a/chrome/browser/ui/webui/options/autofill_options_handler.cc
+++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc
@@ -202,8 +202,7 @@ void AutoFillOptionsHandler::LoadAutoFillData() {
addresses.Append(entry);
}
- web_ui_->CallJavascriptFunction(L"AutoFillOptions.setAddressList",
- addresses);
+ web_ui_->CallJavascriptFunction("AutoFillOptions.setAddressList", addresses);
ListValue credit_cards;
for (std::vector<CreditCard*>::const_iterator i =
@@ -218,7 +217,7 @@ void AutoFillOptionsHandler::LoadAutoFillData() {
credit_cards.Append(entry);
}
- web_ui_->CallJavascriptFunction(L"AutoFillOptions.setCreditCardList",
+ web_ui_->CallJavascriptFunction("AutoFillOptions.setCreditCardList",
credit_cards);
}
@@ -292,7 +291,7 @@ void AutoFillOptionsHandler::LoadAddressEditor(const ListValue* args) {
address.SetString("email",
profile->GetFieldText(AutofillType(EMAIL_ADDRESS)));
- web_ui_->CallJavascriptFunction(L"AutoFillOptions.editAddress", address);
+ web_ui_->CallJavascriptFunction("AutoFillOptions.editAddress", address);
}
void AutoFillOptionsHandler::LoadCreditCardEditor(const ListValue* args) {
@@ -331,7 +330,7 @@ void AutoFillOptionsHandler::LoadCreditCardEditor(const ListValue* args) {
"expirationYear",
credit_card->GetFieldText(AutofillType(CREDIT_CARD_EXP_4_DIGIT_YEAR)));
- web_ui_->CallJavascriptFunction(L"AutoFillOptions.editCreditCard",
+ web_ui_->CallJavascriptFunction("AutoFillOptions.editCreditCard",
credit_card_data);
}
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 4fe2f7e..f2ac21a 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -231,9 +231,10 @@ void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) {
(status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT ||
status_string_id == IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT)));
- web_ui_->CallJavascriptFunction(
- L"BrowserOptions.updateDefaultBrowserState",
- *(status_string.get()), *(is_default.get()), *(can_be_default.get()));
+ web_ui_->CallJavascriptFunction("BrowserOptions.updateDefaultBrowserState",
+ *(status_string.get()),
+ *(is_default.get()),
+ *(can_be_default.get()));
}
void BrowserOptionsHandler::OnTemplateURLModelChanged() {
@@ -261,7 +262,7 @@ void BrowserOptionsHandler::OnTemplateURLModelChanged() {
scoped_ptr<Value> default_value(Value::CreateIntegerValue(default_index));
- web_ui_->CallJavascriptFunction(L"BrowserOptions.updateSearchEngines",
+ web_ui_->CallJavascriptFunction("BrowserOptions.updateSearchEngines",
search_engines, *(default_value.get()));
}
@@ -315,7 +316,7 @@ void BrowserOptionsHandler::OnModelChanged() {
startup_pages.Append(entry);
}
- web_ui_->CallJavascriptFunction(L"BrowserOptions.updateStartupPages",
+ web_ui_->CallJavascriptFunction("BrowserOptions.updateStartupPages",
startup_pages);
}
diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc
index f641d34..67397a2 100644
--- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc
@@ -450,7 +450,7 @@ void CertificateManagerHandler::View(const ListValue* args) {
void CertificateManagerHandler::GetCATrust(const ListValue* args) {
net::X509Certificate* cert = CallbackArgsToCert(args);
if (!cert) {
- web_ui_->CallJavascriptFunction(L"CertificateEditCaTrustOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
return;
}
@@ -461,7 +461,7 @@ void CertificateManagerHandler::GetCATrust(const ListValue* args) {
FundamentalValue obj_sign_value(
bool(trust & net::CertDatabase::TRUSTED_OBJ_SIGN));
web_ui_->CallJavascriptFunction(
- L"CertificateEditCaTrustOverlay.populateTrust",
+ "CertificateEditCaTrustOverlay.populateTrust",
ssl_value, email_value, obj_sign_value);
}
@@ -476,7 +476,7 @@ void CertificateManagerHandler::EditCATrust(const ListValue* args) {
fail |= !CallbackArgsToBool(args, 3, &trust_obj_sign);
if (fail) {
LOG(ERROR) << "EditCATrust args fail";
- web_ui_->CallJavascriptFunction(L"CertificateEditCaTrustOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
return;
}
@@ -486,7 +486,7 @@ void CertificateManagerHandler::EditCATrust(const ListValue* args) {
trust_ssl * net::CertDatabase::TRUSTED_SSL +
trust_email * net::CertDatabase::TRUSTED_EMAIL +
trust_obj_sign * net::CertDatabase::TRUSTED_OBJ_SIGN);
- web_ui_->CallJavascriptFunction(L"CertificateEditCaTrustOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
if (!result) {
// TODO(mattm): better error messages?
ShowError(
@@ -528,13 +528,13 @@ void CertificateManagerHandler::ExportPersonalFileSelected(
const FilePath& path) {
file_path_ = path;
web_ui_->CallJavascriptFunction(
- L"CertificateManager.exportPersonalAskPassword");
+ "CertificateManager.exportPersonalAskPassword");
}
void CertificateManagerHandler::ExportPersonalPasswordSelected(
const ListValue* args) {
if (!args->GetString(0, &password_)){
- web_ui_->CallJavascriptFunction(L"CertificateRestoreOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateRestoreOverlay.dismiss");
ImportExportCleanup();
return;
}
@@ -560,7 +560,7 @@ void CertificateManagerHandler::ExportPersonalSlotsUnlocked() {
password_,
&output);
if (!num_exported) {
- web_ui_->CallJavascriptFunction(L"CertificateRestoreOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateRestoreOverlay.dismiss");
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_EXPORT_ERROR_TITLE),
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
@@ -576,7 +576,7 @@ void CertificateManagerHandler::ExportPersonalSlotsUnlocked() {
void CertificateManagerHandler::ExportPersonalFileWritten(int write_errno,
int bytes_written) {
- web_ui_->CallJavascriptFunction(L"CertificateRestoreOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateRestoreOverlay.dismiss");
ImportExportCleanup();
if (write_errno) {
ShowError(
@@ -605,13 +605,13 @@ void CertificateManagerHandler::ImportPersonalFileSelected(
const FilePath& path) {
file_path_ = path;
web_ui_->CallJavascriptFunction(
- L"CertificateManager.importPersonalAskPassword");
+ "CertificateManager.importPersonalAskPassword");
}
void CertificateManagerHandler::ImportPersonalPasswordSelected(
const ListValue* args) {
if (!args->GetString(0, &password_)){
- web_ui_->CallJavascriptFunction(L"CertificateRestoreOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateRestoreOverlay.dismiss");
ImportExportCleanup();
return;
}
@@ -625,7 +625,7 @@ void CertificateManagerHandler::ImportPersonalFileRead(
int read_errno, std::string data) {
if (read_errno) {
ImportExportCleanup();
- web_ui_->CallJavascriptFunction(L"CertificateRestoreOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateRestoreOverlay.dismiss");
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE),
l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_READ_ERROR_FORMAT,
@@ -652,7 +652,7 @@ void CertificateManagerHandler::ImportPersonalSlotUnlocked() {
int result = certificate_manager_model_->ImportFromPKCS12(
module_, file_data_, password_);
ImportExportCleanup();
- web_ui_->CallJavascriptFunction(L"CertificateRestoreOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateRestoreOverlay.dismiss");
switch (result) {
case net::OK:
break;
@@ -784,7 +784,7 @@ void CertificateManagerHandler::ImportCAFileRead(int read_errno,
// TODO(mattm): check here if root_cert is not a CA cert and show error.
StringValue cert_name(root_cert->subject().GetDisplayName());
- web_ui_->CallJavascriptFunction(L"CertificateEditCaTrustOverlay.showImport",
+ web_ui_->CallJavascriptFunction("CertificateEditCaTrustOverlay.showImport",
cert_name);
}
@@ -799,7 +799,7 @@ void CertificateManagerHandler::ImportCATrustSelected(const ListValue* args) {
if (fail) {
LOG(ERROR) << "ImportCATrustSelected args fail";
ImportExportCleanup();
- web_ui_->CallJavascriptFunction(L"CertificateEditCaTrustOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
return;
}
@@ -810,7 +810,7 @@ void CertificateManagerHandler::ImportCATrustSelected(const ListValue* args) {
trust_email * net::CertDatabase::TRUSTED_EMAIL +
trust_obj_sign * net::CertDatabase::TRUSTED_OBJ_SIGN,
&not_imported);
- web_ui_->CallJavascriptFunction(L"CertificateEditCaTrustOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("CertificateEditCaTrustOverlay.dismiss");
if (!result) {
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
@@ -899,7 +899,7 @@ void CertificateManagerHandler::PopulateTree(const std::string& tab_name,
ListValue args;
args.Append(Value::CreateStringValue(tree_name));
args.Append(nodes);
- web_ui_->CallJavascriptFunction(L"CertificateManager.onPopulateTree", args);
+ web_ui_->CallJavascriptFunction("CertificateManager.onPopulateTree", args);
}
}
@@ -912,7 +912,7 @@ void CertificateManagerHandler::ShowError(const std::string& title,
args.push_back(Value::CreateNullValue()); // cancelTitle
args.push_back(Value::CreateNullValue()); // okCallback
args.push_back(Value::CreateNullValue()); // cancelCallback
- web_ui_->CallJavascriptFunction(L"AlertOverlay.show", args.get());
+ web_ui_->CallJavascriptFunction("AlertOverlay.show", args.get());
}
void CertificateManagerHandler::ShowImportErrors(
@@ -938,7 +938,7 @@ void CertificateManagerHandler::ShowImportErrors(
StringValue title_value(title);
StringValue error_value(error);
- web_ui_->CallJavascriptFunction(L"CertificateImportErrorOverlay.show",
+ web_ui_->CallJavascriptFunction("CertificateImportErrorOverlay.show",
title_value,
error_value,
cert_error_list);
diff --git a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
index 9de5636..010c92c 100644
--- a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
+++ b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
@@ -139,7 +139,7 @@ void ClearBrowserDataHandler::HandleClearBrowserData(const ListValue* value) {
int period_selected = prefs->GetInteger(prefs::kDeleteTimePeriod);
FundamentalValue state(true);
- web_ui_->CallJavascriptFunction(L"ClearBrowserDataOverlay.setClearingState",
+ web_ui_->CallJavascriptFunction("ClearBrowserDataOverlay.setClearingState",
state);
// BrowsingDataRemover deletes itself when done.
@@ -157,7 +157,7 @@ void ClearBrowserDataHandler::UpdateClearPluginLSOData() {
scoped_ptr<Value> label(
Value::CreateStringValue(l10n_util::GetStringUTF16(label_id)));
web_ui_->CallJavascriptFunction(
- L"ClearBrowserDataOverlay.setClearLocalDataLabel", *label);
+ "ClearBrowserDataOverlay.setClearLocalDataLabel", *label);
}
void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() {
@@ -165,5 +165,5 @@ void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() {
// itself after we return.
remover_ = NULL;
DCHECK(web_ui_);
- web_ui_->CallJavascriptFunction(L"ClearBrowserDataOverlay.doneClearing");
+ web_ui_->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing");
}
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index 9bb3c1c..89c47ef 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -258,8 +258,8 @@ void ContentSettingsHandler::Initialize() {
const HostContentSettingsMap* settings_map = GetContentSettingsMap();
scoped_ptr<Value> block_3rd_party(Value::CreateBooleanValue(
settings_map->BlockThirdPartyCookies()));
- web_ui_->CallJavascriptFunction(
- L"ContentSettings.setBlockThirdPartyCookies", *block_3rd_party.get());
+ web_ui_->CallJavascriptFunction("ContentSettings.setBlockThirdPartyCookies",
+ *block_3rd_party.get());
clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled,
g_browser_process->local_state(),
@@ -298,7 +298,7 @@ void ContentSettingsHandler::Observe(NotificationType type,
Profile* profile = static_cast<Source<Profile> >(source).ptr();
if (profile->IsOffTheRecord()) {
web_ui_->CallJavascriptFunction(
- L"ContentSettingsExceptionsArea.OTRProfileDestroyed");
+ "ContentSettingsExceptionsArea.OTRProfileDestroyed");
}
break;
}
@@ -353,7 +353,7 @@ void ContentSettingsHandler::UpdateClearPluginLSOData() {
scoped_ptr<Value> label(
Value::CreateStringValue(l10n_util::GetStringUTF16(label_id)));
web_ui_->CallJavascriptFunction(
- L"ContentSettings.setClearLocalDataOnShutdownLabel", *label);
+ "ContentSettings.setClearLocalDataOnShutdownLabel", *label);
}
void ContentSettingsHandler::UpdateSettingDefaultFromModel(
@@ -365,7 +365,7 @@ void ContentSettingsHandler::UpdateSettingDefaultFromModel(
GetDefaultSettingManagedFromModel(type));
web_ui_->CallJavascriptFunction(
- L"ContentSettings.setContentFilterSettingsValue", filter_settings);
+ "ContentSettings.setContentFilterSettingsValue", filter_settings);
}
std::string ContentSettingsHandler::GetSettingDefaultFromModel(
@@ -481,8 +481,8 @@ void ContentSettingsHandler::UpdateGeolocationExceptionsView() {
StringValue type_string(
ContentSettingsTypeToGroupName(CONTENT_SETTINGS_TYPE_GEOLOCATION));
- web_ui_->CallJavascriptFunction(
- L"ContentSettings.setExceptions", type_string, exceptions);
+ web_ui_->CallJavascriptFunction("ContentSettings.setExceptions",
+ type_string, exceptions);
// This is mainly here to keep this function ideologically parallel to
// UpdateExceptionsViewFromHostContentSettingsMap().
@@ -508,8 +508,8 @@ void ContentSettingsHandler::UpdateNotificationExceptionsView() {
StringValue type_string(
ContentSettingsTypeToGroupName(CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
- web_ui_->CallJavascriptFunction(
- L"ContentSettings.setExceptions", type_string, exceptions);
+ web_ui_->CallJavascriptFunction("ContentSettings.setExceptions",
+ type_string, exceptions);
// This is mainly here to keep this function ideologically parallel to
// UpdateExceptionsViewFromHostContentSettingsMap().
@@ -527,8 +527,8 @@ void ContentSettingsHandler::UpdateExceptionsViewFromHostContentSettingsMap(
}
StringValue type_string(ContentSettingsTypeToGroupName(type));
- web_ui_->CallJavascriptFunction(
- L"ContentSettings.setExceptions", type_string, exceptions);
+ web_ui_->CallJavascriptFunction("ContentSettings.setExceptions", type_string,
+ exceptions);
UpdateExceptionsViewFromOTRHostContentSettingsMap(type);
@@ -553,8 +553,8 @@ void ContentSettingsHandler::UpdateExceptionsViewFromOTRHostContentSettingsMap(
}
StringValue type_string(ContentSettingsTypeToGroupName(type));
- web_ui_->CallJavascriptFunction(
- L"ContentSettings.setOTRExceptions", type_string, otr_exceptions);
+ web_ui_->CallJavascriptFunction("ContentSettings.setOTRExceptions",
+ type_string, otr_exceptions);
}
void ContentSettingsHandler::RegisterMessages() {
@@ -599,9 +599,10 @@ void ContentSettingsHandler::SetContentFilter(const ListValue* args) {
}
void ContentSettingsHandler::SetAllowThirdPartyCookies(const ListValue* args) {
- std::wstring allow = ExtractStringValue(args);
+ string16 allow = ExtractStringValue(args);
- GetContentSettingsMap()->SetBlockThirdPartyCookies(allow == L"true");
+ GetContentSettingsMap()->SetBlockThirdPartyCookies(
+ LowerCaseEqualsASCII(allow, "true"));
}
void ContentSettingsHandler::RemoveException(const ListValue* args) {
@@ -712,10 +713,11 @@ void ContentSettingsHandler::CheckExceptionPatternValidity(
scoped_ptr<Value> valid_value(Value::CreateBooleanValue(pattern.IsValid()));
web_ui_->CallJavascriptFunction(
- L"ContentSettings.patternValidityCheckComplete", *type,
- *mode_value.get(),
- *pattern_value.get(),
- *valid_value.get());
+ "ContentSettings.patternValidityCheckComplete",
+ *type,
+ *mode_value.get(),
+ *pattern_value.get(),
+ *valid_value.get());
}
// static
diff --git a/chrome/browser/ui/webui/options/cookies_view_handler.cc b/chrome/browser/ui/webui/options/cookies_view_handler.cc
index 2ac700e0..7710df2 100644
--- a/chrome/browser/ui/webui/options/cookies_view_handler.cc
+++ b/chrome/browser/ui/webui/options/cookies_view_handler.cc
@@ -114,7 +114,7 @@ void CookiesViewHandler::TreeNodesAdded(ui::TreeModel* model,
cookies_tree_model_util::GetTreeNodeId(parent_node)));
args.Append(Value::CreateIntegerValue(start));
args.Append(children);
- web_ui_->CallJavascriptFunction(L"CookiesView.onTreeItemAdded", args);
+ web_ui_->CallJavascriptFunction("CookiesView.onTreeItemAdded", args);
}
void CookiesViewHandler::TreeNodesRemoved(ui::TreeModel* model,
@@ -132,7 +132,7 @@ void CookiesViewHandler::TreeNodesRemoved(ui::TreeModel* model,
cookies_tree_model_->AsNode(parent))));
args.Append(Value::CreateIntegerValue(start));
args.Append(Value::CreateIntegerValue(count));
- web_ui_->CallJavascriptFunction(L"CookiesView.onTreeItemRemoved", args);
+ web_ui_->CallJavascriptFunction("CookiesView.onTreeItemRemoved", args);
}
void CookiesViewHandler::TreeModelBeginBatch(CookiesTreeModel* model) {
@@ -207,5 +207,5 @@ void CookiesViewHandler::SendChildren(CookieTreeNode* parent) {
Value::CreateStringValue(cookies_tree_model_util::GetTreeNodeId(parent)));
args.Append(children);
- web_ui_->CallJavascriptFunction(L"CookiesView.loadChildren", args);
+ web_ui_->CallJavascriptFunction("CookiesView.loadChildren", args);
}
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index cec297f..0d290ef 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -234,7 +234,7 @@ void CoreOptionsHandler::HandleFetchPrefs(const ListValue* args) {
result_value.Set(pref_name.c_str(), FetchPref(pref_name));
}
- web_ui_->CallJavascriptFunction(UTF16ToWideHack(callback_function).c_str(),
+ web_ui_->CallJavascriptFunction(UTF16ToASCII(callback_function),
result_value);
}
@@ -345,7 +345,7 @@ void CoreOptionsHandler::HandleClearPref(const ListValue* args) {
}
void CoreOptionsHandler::HandleUserMetricsAction(const ListValue* args) {
- std::string metric = WideToUTF8(ExtractStringValue(args));
+ std::string metric = UTF16ToUTF8(ExtractStringValue(args));
if (!metric.empty())
UserMetricsRecordAction(UserMetricsAction(metric.c_str()));
}
@@ -367,7 +367,8 @@ void CoreOptionsHandler::NotifyPrefChanged(const std::string* pref_name) {
dict->SetBoolean("managed", pref->IsManaged());
result_value.Append(dict);
- web_ui_->CallJavascriptFunction(callback_function, result_value);
+ web_ui_->CallJavascriptFunction(WideToASCII(callback_function),
+ result_value);
}
}
}
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc
index 2fbbeb9..707a0cfd 100644
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc
@@ -141,7 +141,7 @@ void FontSettingsHandler::FontsListHasLoaded() {
selected_values.Append(Value::CreateStringValue(fixed_font_.GetValue()));
selected_values.Append(Value::CreateStringValue(font_encoding_.GetValue()));
- web_ui_->CallJavascriptFunction(L"FontSettings.setFontsData",
+ web_ui_->CallJavascriptFunction("FontSettings.setFontsData",
*fonts_list, encoding_list, selected_values);
}
@@ -166,18 +166,18 @@ void FontSettingsHandler::SetupStandardFontSample() {
StringValue font_value(standard_font_.GetValue());
FundamentalValue size_value(default_font_size_.GetValue());
web_ui_->CallJavascriptFunction(
- L"FontSettings.setupStandardFontSample", font_value, size_value);
+ "FontSettings.setupStandardFontSample", font_value, size_value);
}
void FontSettingsHandler::SetupFixedFontSample() {
StringValue font_value(fixed_font_.GetValue());
FundamentalValue size_value(default_fixed_font_size_.GetValue());
web_ui_->CallJavascriptFunction(
- L"FontSettings.setupFixedFontSample", font_value, size_value);
+ "FontSettings.setupFixedFontSample", font_value, size_value);
}
void FontSettingsHandler::SetupMinimumFontSample() {
FundamentalValue size_value(minimum_font_size_.GetValue());
- web_ui_->CallJavascriptFunction(
- L"FontSettings.setupMinimumFontSample", size_value);
+ web_ui_->CallJavascriptFunction("FontSettings.setupMinimumFontSample",
+ size_value);
}
diff --git a/chrome/browser/ui/webui/options/import_data_handler.cc b/chrome/browser/ui/webui/options/import_data_handler.cc
index ba5f8d8..f7ae271 100644
--- a/chrome/browser/ui/webui/options/import_data_handler.cc
+++ b/chrome/browser/ui/webui/options/import_data_handler.cc
@@ -94,8 +94,8 @@ void ImportDataHandler::ImportData(const ListValue* args) {
uint16 import_services = (selected_items & supported_items);
if (import_services) {
FundamentalValue state(true);
- web_ui_->CallJavascriptFunction(
- L"ImportDataOverlay.setImportingState", state);
+ web_ui_->CallJavascriptFunction("ImportDataOverlay.setImportingState",
+ state);
// TODO(csilv): Out-of-process import has only been qualified on MacOS X,
// so we will only use it on that platform since it is required. Remove this
@@ -142,8 +142,7 @@ void ImportDataHandler::SourceProfilesLoaded() {
}
web_ui_->CallJavascriptFunction(
- L"options.ImportDataOverlay.updateSupportedBrowsers",
- browser_profiles);
+ "options.ImportDataOverlay.updateSupportedBrowsers", browser_profiles);
}
void ImportDataHandler::ImportStarted() {
@@ -161,5 +160,5 @@ void ImportDataHandler::ImportEnded() {
importer_host_->SetObserver(NULL);
importer_host_ = NULL;
- web_ui_->CallJavascriptFunction(L"ImportDataOverlay.dismiss");
+ web_ui_->CallJavascriptFunction("ImportDataOverlay.dismiss");
}
diff --git a/chrome/browser/ui/webui/options/language_options_handler_common.cc b/chrome/browser/ui/webui/options/language_options_handler_common.cc
index 79fb1f9..572d323 100644
--- a/chrome/browser/ui/webui/options/language_options_handler_common.cc
+++ b/chrome/browser/ui/webui/options/language_options_handler_common.cc
@@ -144,19 +144,18 @@ void LanguageOptionsHandlerCommon::LanguageOptionsOpenCallback(
void LanguageOptionsHandlerCommon::UiLanguageChangeCallback(
const ListValue* args) {
- const std::string language_code = WideToASCII(ExtractStringValue(args));
+ const std::string language_code = UTF16ToASCII(ExtractStringValue(args));
CHECK(!language_code.empty());
const std::string action = StringPrintf(
"LanguageOptions_UiLanguageChange_%s", language_code.c_str());
UserMetrics::RecordComputedAction(action);
SetApplicationLocale(language_code);
- web_ui_->CallJavascriptFunction(
- L"options.LanguageOptions.uiLanguageSaved");
+ web_ui_->CallJavascriptFunction("options.LanguageOptions.uiLanguageSaved");
}
void LanguageOptionsHandlerCommon::SpellCheckLanguageChangeCallback(
const ListValue* args) {
- const std::string language_code = WideToASCII(ExtractStringValue(args));
+ const std::string language_code = UTF16ToASCII(ExtractStringValue(args));
CHECK(!language_code.empty());
const std::string action = StringPrintf(
"LanguageOptions_SpellCheckLanguageChange_%s", language_code.c_str());
diff --git a/chrome/browser/ui/webui/options/options_managed_banner_handler.cc b/chrome/browser/ui/webui/options/options_managed_banner_handler.cc
index 144ddff..ddf3785 100644
--- a/chrome/browser/ui/webui/options/options_managed_banner_handler.cc
+++ b/chrome/browser/ui/webui/options/options_managed_banner_handler.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/ui/webui/options/options_managed_banner_handler.h"
-#include "base/utf_string_conversions.h"
+#include "base/string_util.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
#include "content/browser/webui/web_ui.h"
@@ -27,12 +27,12 @@ void OptionsManagedBannerHandler::OnUpdateVisibility() {
void OptionsManagedBannerHandler::SetupBannerVisibility() {
// Construct the banner visibility script name.
- string16 script = ASCIIToUTF16("options.") + page_name_ +
- ASCIIToUTF16(".getInstance().setManagedBannerVisibility");
+ std::string script = "options." + UTF16ToASCII(page_name_) +
+ ".getInstance().setManagedBannerVisibility";
// Get the visiblity value from the base class.
FundamentalValue visibility(DetermineVisibility());
// Set the managed state in the javascript handler.
- web_ui_->CallJavascriptFunction(UTF16ToWideHack(script), visibility);
+ web_ui_->CallJavascriptFunction(script, visibility);
}
diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc
index dcb2d91..1277fce 100644
--- a/chrome/browser/ui/webui/options/options_ui.cc
+++ b/chrome/browser/ui/webui/options/options_ui.cc
@@ -270,7 +270,7 @@ void OptionsUI::DidBecomeActiveForReusedRenderView() {
// won't fire to initilize the handlers. To make sure initialization always
// happens, call reinitializeCore (which is a no-op unless the DOM was already
// initialized).
- CallJavascriptFunction(L"OptionsPage.reinitializeCore");
+ CallJavascriptFunction("OptionsPage.reinitializeCore");
WebUI::DidBecomeActiveForReusedRenderView();
}
diff --git a/chrome/browser/ui/webui/options/password_manager_handler.cc b/chrome/browser/ui/webui/options/password_manager_handler.cc
index 70ffeff..7fdd439 100644
--- a/chrome/browser/ui/webui/options/password_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/password_manager_handler.cc
@@ -87,7 +87,7 @@ void PasswordManagerHandler::UpdatePasswordLists(const ListValue* args) {
}
void PasswordManagerHandler::RemoveSavedPassword(const ListValue* args) {
- std::string string_value = WideToUTF8(ExtractStringValue(args));
+ std::string string_value = UTF16ToUTF8(ExtractStringValue(args));
int index;
base::StringToInt(string_value, &index);
@@ -99,7 +99,7 @@ void PasswordManagerHandler::RemoveSavedPassword(const ListValue* args) {
void PasswordManagerHandler::RemovePasswordException(
const ListValue* args) {
- std::string string_value = WideToUTF8(ExtractStringValue(args));
+ std::string string_value = UTF16ToUTF8(ExtractStringValue(args));
int index;
base::StringToInt(string_value, &index);
@@ -138,8 +138,8 @@ void PasswordManagerHandler::SetPasswordList() {
entries.Append(entry);
}
- web_ui_->CallJavascriptFunction(
- L"PasswordManager.setSavedPasswordsList", entries);
+ web_ui_->CallJavascriptFunction("PasswordManager.setSavedPasswordsList",
+ entries);
}
void PasswordManagerHandler::SetPasswordExceptionList() {
@@ -149,8 +149,8 @@ void PasswordManagerHandler::SetPasswordExceptionList() {
net::FormatUrl(password_exception_list_[i]->origin, languages_)));
}
- web_ui_->CallJavascriptFunction(
- L"PasswordManager.setPasswordExceptionsList", entries);
+ web_ui_->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList",
+ entries);
}
PasswordManagerHandler::ListPopulater::ListPopulater(
diff --git a/chrome/browser/ui/webui/options/personal_options_handler.cc b/chrome/browser/ui/webui/options/personal_options_handler.cc
index 7395bb3..8589280 100644
--- a/chrome/browser/ui/webui/options/personal_options_handler.cc
+++ b/chrome/browser/ui/webui/options/personal_options_handler.cc
@@ -237,38 +237,37 @@ void PersonalOptionsHandler::OnStateChanged() {
}
scoped_ptr<Value> completed(Value::CreateBooleanValue(sync_setup_completed));
- web_ui_->CallJavascriptFunction(L"PersonalOptions.setSyncSetupCompleted",
+ web_ui_->CallJavascriptFunction("PersonalOptions.setSyncSetupCompleted",
*completed);
scoped_ptr<Value> label(Value::CreateStringValue(status_label));
- web_ui_->CallJavascriptFunction(L"PersonalOptions.setSyncStatus",
- *label);
+ web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatus", *label);
scoped_ptr<Value> enabled(
Value::CreateBooleanValue(is_start_stop_button_enabled));
- web_ui_->CallJavascriptFunction(L"PersonalOptions.setStartStopButtonEnabled",
+ web_ui_->CallJavascriptFunction("PersonalOptions.setStartStopButtonEnabled",
*enabled);
scoped_ptr<Value> visible(
Value::CreateBooleanValue(is_start_stop_button_visible));
- web_ui_->CallJavascriptFunction(L"PersonalOptions.setStartStopButtonVisible",
+ web_ui_->CallJavascriptFunction("PersonalOptions.setStartStopButtonVisible",
*visible);
label.reset(Value::CreateStringValue(start_stop_button_label));
- web_ui_->CallJavascriptFunction(L"PersonalOptions.setStartStopButtonLabel",
+ web_ui_->CallJavascriptFunction("PersonalOptions.setStartStopButtonLabel",
*label);
label.reset(Value::CreateStringValue(link_label));
- web_ui_->CallJavascriptFunction(L"PersonalOptions.setSyncActionLinkLabel",
+ web_ui_->CallJavascriptFunction("PersonalOptions.setSyncActionLinkLabel",
*label);
enabled.reset(Value::CreateBooleanValue(!managed));
- web_ui_->CallJavascriptFunction(L"PersonalOptions.setSyncActionLinkEnabled",
+ web_ui_->CallJavascriptFunction("PersonalOptions.setSyncActionLinkEnabled",
*enabled);
visible.reset(Value::CreateBooleanValue(status_has_error));
- web_ui_->CallJavascriptFunction(
- L"PersonalOptions.setSyncStatusErrorVisible", *visible);
+ web_ui_->CallJavascriptFunction("PersonalOptions.setSyncStatusErrorVisible",
+ *visible);
}
void PersonalOptionsHandler::OnLoginSuccess() {
@@ -287,7 +286,7 @@ void PersonalOptionsHandler::ObserveThemeChanged() {
bool is_gtk_theme = provider->UseGtkTheme();
FundamentalValue gtk_enabled(!is_gtk_theme);
web_ui_->CallJavascriptFunction(
- L"options.PersonalOptions.setGtkThemeButtonEnabled", gtk_enabled);
+ "options.PersonalOptions.setGtkThemeButtonEnabled", gtk_enabled);
#else
BrowserThemeProvider* provider =
reinterpret_cast<BrowserThemeProvider*>(profile->GetThemeProvider());
@@ -297,7 +296,7 @@ void PersonalOptionsHandler::ObserveThemeChanged() {
bool is_classic_theme = !is_gtk_theme && provider->UsingDefaultTheme();
FundamentalValue enabled(!is_classic_theme);
web_ui_->CallJavascriptFunction(
- L"options.PersonalOptions.setThemesResetButtonEnabled", enabled);
+ "options.PersonalOptions.setThemesResetButtonEnabled", enabled);
}
void PersonalOptionsHandler::Initialize() {
@@ -320,10 +319,10 @@ void PersonalOptionsHandler::Initialize() {
DictionaryValue args;
SyncSetupFlow::GetArgsForConfigure(sync_service, &args);
- web_ui_->CallJavascriptFunction(
- L"PersonalOptions.setRegisteredDataTypes", args);
+ web_ui_->CallJavascriptFunction("PersonalOptions.setRegisteredDataTypes",
+ args);
} else {
- web_ui_->CallJavascriptFunction(L"options.PersonalOptions.hideSyncSection");
+ web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection");
}
}
@@ -394,8 +393,8 @@ void PersonalOptionsHandler::LoadAccountPicture(const ListValue* args) {
std::string email = chromeos::UserManager::Get()->logged_in_user().email();
if (!email.empty()) {
StringValue image_url(chrome::kChromeUIUserImageURL + email);
- web_ui_->CallJavascriptFunction(L"PersonalOptions.setAccountPicture",
- image_url);
+ web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture",
+ image_url);
}
}
#endif
diff --git a/chrome/browser/ui/webui/options/search_engine_manager_handler.cc b/chrome/browser/ui/webui/options/search_engine_manager_handler.cc
index 4a28e23..28b1e20 100644
--- a/chrome/browser/ui/webui/options/search_engine_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/search_engine_manager_handler.cc
@@ -125,7 +125,7 @@ void SearchEngineManagerHandler::OnModelChanged() {
others_list.Append(CreateDictionaryForEngine(i, i == default_index));
}
- web_ui_->CallJavascriptFunction(L"SearchEngineManager.updateSearchEngineList",
+ web_ui_->CallJavascriptFunction("SearchEngineManager.updateSearchEngineList",
defaults_list, others_list);
}
@@ -246,8 +246,8 @@ void SearchEngineManagerHandler::CheckSearchEngineInfoValidity(
validity.SetBoolean("keyword", edit_controller_->IsKeywordValid(keyword));
validity.SetBoolean("url", edit_controller_->IsURLValid(url));
StringValue indexValue(modelIndex);
- web_ui_->CallJavascriptFunction(
- L"SearchEngineManager.validityCheckCallback", validity, indexValue);
+ web_ui_->CallJavascriptFunction("SearchEngineManager.validityCheckCallback",
+ validity, indexValue);
}
void SearchEngineManagerHandler::EditCancelled(const ListValue* args) {
diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
index 96cf163..b6bc8aa 100644
--- a/chrome/browser/ui/webui/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins_ui.cc
@@ -293,7 +293,7 @@ void PluginsDOMHandler::HandleSaveShowDetailsToPrefs(const ListValue* args) {
void PluginsDOMHandler::HandleGetShowDetails(const ListValue* args) {
FundamentalValue show_details(show_details_.GetValue());
- web_ui_->CallJavascriptFunction(L"loadShowDetailsFromPrefs", show_details);
+ web_ui_->CallJavascriptFunction("loadShowDetailsFromPrefs", show_details);
}
void PluginsDOMHandler::Observe(NotificationType type,
@@ -338,7 +338,7 @@ void PluginsDOMHandler::PluginsLoaded(ListWrapper* wrapper) {
DictionaryValue results;
results.Set("plugins", wrapper->list);
wrapper->list = NULL; // So it doesn't get deleted.
- web_ui_->CallJavascriptFunction(L"returnPluginsData", results);
+ web_ui_->CallJavascriptFunction("returnPluginsData", results);
}
} // namespace
diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc
index 106d096..66a3da3 100644
--- a/chrome/browser/ui/webui/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview_handler.cc
@@ -122,5 +122,5 @@ void PrintPreviewHandler::HandlePrint(const ListValue* args) {
}
void PrintPreviewHandler::SendPrinterList(const ListValue& printers) {
- web_ui_->CallJavascriptFunction(L"setPrinters", printers);
+ web_ui_->CallJavascriptFunction("setPrinters", printers);
}
diff --git a/chrome/browser/ui/webui/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview_ui.cc
index f116ac7..d3b243c 100644
--- a/chrome/browser/ui/webui/print_preview_ui.cc
+++ b/chrome/browser/ui/webui/print_preview_ui.cc
@@ -32,5 +32,5 @@ PrintPreviewUIHTMLSource* PrintPreviewUI::html_source() {
void PrintPreviewUI::PreviewDataIsAvailable(int expected_pages_count) {
StringValue dummy_url("chrome://print/print.pdf");
FundamentalValue pages_count(expected_pages_count);
- CallJavascriptFunction(L"createPDFPlugin", dummy_url, pages_count);
+ CallJavascriptFunction("createPDFPlugin", dummy_url, pages_count);
}
diff --git a/chrome/browser/ui/webui/shown_sections_handler.cc b/chrome/browser/ui/webui/shown_sections_handler.cc
index c2afbdb..4ad68e8 100644
--- a/chrome/browser/ui/webui/shown_sections_handler.cc
+++ b/chrome/browser/ui/webui/shown_sections_handler.cc
@@ -78,7 +78,7 @@ void ShownSectionsHandler::Observe(NotificationType type,
DCHECK(*pref_name == prefs::kNTPShownSections);
int sections = pref_service_->GetInteger(prefs::kNTPShownSections);
FundamentalValue sections_value(sections);
- web_ui_->CallJavascriptFunction(L"setShownSections", sections_value);
+ web_ui_->CallJavascriptFunction("setShownSections", sections_value);
} else {
NOTREACHED();
}
@@ -87,7 +87,7 @@ void ShownSectionsHandler::Observe(NotificationType type,
void ShownSectionsHandler::HandleGetShownSections(const ListValue* args) {
int sections = GetShownSections(pref_service_);
FundamentalValue sections_value(sections);
- web_ui_->CallJavascriptFunction(L"onShownSections", sections_value);
+ web_ui_->CallJavascriptFunction("onShownSections", sections_value);
}
void ShownSectionsHandler::HandleSetShownSections(const ListValue* args) {
diff --git a/chrome/browser/ui/webui/slideshow_ui.cc b/chrome/browser/ui/webui/slideshow_ui.cc
index eb8377c..9b60864 100644
--- a/chrome/browser/ui/webui/slideshow_ui.cc
+++ b/chrome/browser/ui/webui/slideshow_ui.cc
@@ -167,7 +167,7 @@ void SlideshowHandler::RegisterMessages() {
void SlideshowHandler::HandleRefreshDirectory(const ListValue* args) {
#if defined(OS_CHROMEOS)
- std::string path = WideToUTF8(ExtractStringValue(args));
+ std::string path = UTF16ToUTF8(ExtractStringValue(args));
GetChildrenForPath(FilePath(path), true);
#endif
}
@@ -200,7 +200,7 @@ void SlideshowHandler::GetChildrenForPath(const FilePath& path,
void SlideshowHandler::HandleGetChildren(const ListValue* args) {
#if defined(OS_CHROMEOS)
filelist_value_.reset(new ListValue());
- std::string path = WideToUTF8(ExtractStringValue(args));
+ std::string path = UTF16ToUTF8(ExtractStringValue(args));
GetChildrenForPath(FilePath(path), false);
#endif
}
@@ -263,7 +263,7 @@ void SlideshowHandler::OnListDone(int error) {
info_value.SetString("functionCall", "getChildren");
}
info_value.SetString(kPropertyPath, currentpath_.value());
- web_ui_->CallJavascriptFunction(L"browseFileResult",
+ web_ui_->CallJavascriptFunction("browseFileResult",
info_value, *(filelist_value_.get()));
}
diff --git a/chrome/browser/ui/webui/sync_internals_ui.cc b/chrome/browser/ui/webui/sync_internals_ui.cc
index 30e4bd1..54303d9 100644
--- a/chrome/browser/ui/webui/sync_internals_ui.cc
+++ b/chrome/browser/ui/webui/sync_internals_ui.cc
@@ -72,7 +72,7 @@ void SyncInternalsUI::HandleJsEvent(const std::string& name,
const browser_sync::JsArgList& args) {
VLOG(1) << "Handling event: " << name << " with args " << args.ToString();
std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end());
- CallJavascriptFunction(UTF8ToWide(name), arg_list);
+ CallJavascriptFunction(name, arg_list);
}
browser_sync::JsFrontend* SyncInternalsUI::GetJsFrontend() {
diff --git a/chrome/browser/ui/webui/sync_internals_ui_unittest.cc b/chrome/browser/ui/webui/sync_internals_ui_unittest.cc
index 2e51c7c..d103363 100644
--- a/chrome/browser/ui/webui/sync_internals_ui_unittest.cc
+++ b/chrome/browser/ui/webui/sync_internals_ui_unittest.cc
@@ -35,7 +35,7 @@ class TestSyncInternalsUI : public SyncInternalsUI {
: SyncInternalsUI(contents) {}
virtual ~TestSyncInternalsUI() {}
- MOCK_METHOD1(ExecuteJavascript, void(const std::wstring&));
+ MOCK_METHOD1(ExecuteJavascript, void(const string16&));
};
class SyncInternalsUITest : public RenderViewHostTestHarness {
@@ -139,7 +139,7 @@ TEST_F(SyncInternalsUITest, HandleJsEvent) {
ConstructTestSyncInternalsUI();
EXPECT_CALL(*GetTestSyncInternalsUI(),
- ExecuteJavascript(std::wstring(L"testMessage(5,true);")));
+ ExecuteJavascript(ASCIIToUTF16("testMessage(5,true);")));
ListValue args;
args.Append(Value::CreateIntegerValue(5));
@@ -153,7 +153,7 @@ TEST_F(SyncInternalsUITest, HandleJsEventNullService) {
ConstructTestSyncInternalsUI();
EXPECT_CALL(*GetTestSyncInternalsUI(),
- ExecuteJavascript(std::wstring(L"testMessage(5,true);")));
+ ExecuteJavascript(ASCIIToUTF16("testMessage(5,true);")));
ListValue args;
args.Append(Value::CreateIntegerValue(5));
@@ -191,8 +191,8 @@ TEST_F(SyncInternalsUITest, ProcessWebUIMessageBasicNullService) {
}
namespace {
-const wchar_t kAboutInfoCall[] =
- L"onGetAboutInfoFinished({\"summary\":\"SYNC DISABLED\"});";
+const char kAboutInfoCall[] =
+ "onGetAboutInfoFinished({\"summary\":\"SYNC DISABLED\"});";
} // namespace
TEST_F(SyncInternalsUITest, ProcessWebUIMessageGetAboutInfo) {
@@ -204,7 +204,7 @@ TEST_F(SyncInternalsUITest, ProcessWebUIMessageGetAboutInfo) {
ConstructTestSyncInternalsUI();
EXPECT_CALL(*GetTestSyncInternalsUI(),
- ExecuteJavascript(std::wstring(kAboutInfoCall)));
+ ExecuteJavascript(ASCIIToUTF16(kAboutInfoCall)));
GetTestSyncInternalsUI()->ProcessWebUIMessage(params);
}
@@ -218,7 +218,7 @@ TEST_F(SyncInternalsUITest, ProcessWebUIMessageGetAboutInfoNullService) {
ConstructTestSyncInternalsUI();
EXPECT_CALL(*GetTestSyncInternalsUI(),
- ExecuteJavascript(std::wstring(kAboutInfoCall)));
+ ExecuteJavascript(ASCIIToUTF16(kAboutInfoCall)));
GetTestSyncInternalsUI()->ProcessWebUIMessage(params);
}
diff --git a/chrome/browser/ui/webui/textfields_ui.cc b/chrome/browser/ui/webui/textfields_ui.cc
index 1ca5b1e..6c3c03d 100644
--- a/chrome/browser/ui/webui/textfields_ui.cc
+++ b/chrome/browser/ui/webui/textfields_ui.cc
@@ -56,7 +56,8 @@ void TextfieldsDOMHandler::RegisterMessages() {
}
void TextfieldsDOMHandler::HandleTextfieldValue(const ListValue* args) {
- static_cast<TextfieldsUI*>(web_ui_)->set_text(ExtractStringValue(args));
+ static_cast<TextfieldsUI*>(web_ui_)->set_text(
+ UTF16ToWideHack(ExtractStringValue(args)));
}
/**
diff --git a/chrome/browser/ui/webui/tips_handler.cc b/chrome/browser/ui/webui/tips_handler.cc
index c3f9d41..8778fec 100644
--- a/chrome/browser/ui/webui/tips_handler.cc
+++ b/chrome/browser/ui/webui/tips_handler.cc
@@ -52,7 +52,7 @@ void TipsHandler::HandleGetTips(const ListValue* args) {
prefs::kNTPTipsResourceServer);
std::string locale = g_browser_process->GetApplicationLocale();
if (!EndsWith(server, locale, false)) {
- web_ui_->CallJavascriptFunction(L"tips", list_value);
+ web_ui_->CallJavascriptFunction("tips", list_value);
return;
}
}
@@ -95,7 +95,7 @@ void TipsHandler::SendTip(const std::string& tip, const std::string& tip_type,
tips_cache_->SetInteger(PromoResourceService::kCurrentTipPrefName,
tip_index);
// Send list of web resource items back out to the DOM.
- web_ui_->CallJavascriptFunction(L"tips", list_value);
+ web_ui_->CallJavascriptFunction("tips", list_value);
}
// static