summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 16:29:42 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 16:29:42 +0000
commit88dc06904f5ebf68d962ac3e5c7a77ca64ac4ec0 (patch)
tree136274bffa099a690e9195c7ba9c271bd90cf085 /chrome/browser
parentb1d08c68cf8cc377fa6250642cf668dc67bda05d (diff)
downloadchromium_src-88dc06904f5ebf68d962ac3e5c7a77ca64ac4ec0.zip
chromium_src-88dc06904f5ebf68d962ac3e5c7a77ca64ac4ec0.tar.gz
chromium_src-88dc06904f5ebf68d962ac3e5c7a77ca64ac4ec0.tar.bz2
Convert more wide strings in browser/extensions.
I think this kills off the remaining uses of the now-deprecated wstring DictionaryValue methods. BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3125010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56141 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/extensions/extension_bookmark_manager_api.cc120
-rw-r--r--chrome/browser/extensions/extension_browser_actions_api.cc16
-rw-r--r--chrome/browser/extensions/extension_menu_manager.cc29
-rw-r--r--chrome/browser/extensions/extension_menu_manager_unittest.cc15
-rw-r--r--chrome/browser/extensions/extension_metrics_module.cc10
-rw-r--r--chrome/browser/extensions/extension_page_actions_module.cc26
-rw-r--r--chrome/browser/extensions/extension_proxy_api.cc29
-rw-r--r--chrome/browser/extensions/external_pref_extension_provider.cc5
8 files changed, 125 insertions, 125 deletions
diff --git a/chrome/browser/extensions/extension_bookmark_manager_api.cc b/chrome/browser/extensions/extension_bookmark_manager_api.cc
index c6792bb..3fd8a18 100644
--- a/chrome/browser/extensions/extension_bookmark_manager_api.cc
+++ b/chrome/browser/extensions/extension_bookmark_manager_api.cc
@@ -268,66 +268,66 @@ bool SortChildrenBookmarkManagerFunction::RunImpl() {
bool BookmarkManagerGetStringsFunction::RunImpl() {
DictionaryValue* localized_strings = new DictionaryValue();
- localized_strings->SetString(L"title",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_TITLE));
- localized_strings->SetString(L"search_button",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_SEARCH_BUTTON));
- localized_strings->SetString(L"show_in_folder",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_SHOW_IN_FOLDER));
- localized_strings->SetString(L"sort",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_SORT));
- localized_strings->SetString(L"organize_menu",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_ORGANIZE_MENU));
- localized_strings->SetString(L"tools_menu",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_TOOLS_MENU));
- localized_strings->SetString(L"import_menu",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_IMPORT_MENU));
- localized_strings->SetString(L"export_menu",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_EXPORT_MENU));
- localized_strings->SetString(L"rename_folder",
- l10n_util::GetString(IDS_BOOKMARK_BAR_RENAME_FOLDER));
- localized_strings->SetString(L"edit",
- l10n_util::GetString(IDS_BOOKMARK_BAR_EDIT));
- localized_strings->SetString(L"should_open_all",
- l10n_util::GetString(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL));
- localized_strings->SetString(L"open_incognito",
- l10n_util::GetString(IDS_BOOMARK_BAR_OPEN_INCOGNITO));
- localized_strings->SetString(L"open_in_new_tab",
- l10n_util::GetString(IDS_BOOMARK_BAR_OPEN_IN_NEW_TAB));
- localized_strings->SetString(L"open_in_new_window",
- l10n_util::GetString(IDS_BOOMARK_BAR_OPEN_IN_NEW_WINDOW));
- localized_strings->SetString(L"add_new_bookmark",
- l10n_util::GetString(IDS_BOOMARK_BAR_ADD_NEW_BOOKMARK));
- localized_strings->SetString(L"new_folder",
- l10n_util::GetString(IDS_BOOMARK_BAR_NEW_FOLDER));
- localized_strings->SetString(L"open_all",
- l10n_util::GetString(IDS_BOOMARK_BAR_OPEN_ALL));
- localized_strings->SetString(L"open_all_new_window",
- l10n_util::GetString(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW));
- localized_strings->SetString(L"open_all_incognito",
- l10n_util::GetString(IDS_BOOMARK_BAR_OPEN_ALL_INCOGNITO));
- localized_strings->SetString(L"remove",
- l10n_util::GetString(IDS_BOOKMARK_BAR_REMOVE));
- localized_strings->SetString(L"copy",
- l10n_util::GetString(IDS_CONTENT_CONTEXT_COPY));
- localized_strings->SetString(L"cut",
- l10n_util::GetString(IDS_CONTENT_CONTEXT_CUT));
- localized_strings->SetString(L"paste",
- l10n_util::GetString(IDS_CONTENT_CONTEXT_PASTE));
- localized_strings->SetString(L"delete",
- l10n_util::GetString(IDS_CONTENT_CONTEXT_DELETE));
- localized_strings->SetString(L"new_folder_name",
- l10n_util::GetString(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME));
- localized_strings->SetString(L"name_input_placeholder",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_NAME_INPUT_PLACE_HOLDER));
- localized_strings->SetString(L"url_input_placeholder",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_URL_INPUT_PLACE_HOLDER));
- localized_strings->SetString(L"invalid_url",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_INVALID_URL));
- localized_strings->SetString(L"recent",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_RECENT));
- localized_strings->SetString(L"search",
- l10n_util::GetString(IDS_BOOKMARK_MANAGER_SEARCH));
+ localized_strings->SetString("title",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_TITLE));
+ localized_strings->SetString("search_button",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SEARCH_BUTTON));
+ localized_strings->SetString("show_in_folder",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SHOW_IN_FOLDER));
+ localized_strings->SetString("sort",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SORT));
+ localized_strings->SetString("organize_menu",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_ORGANIZE_MENU));
+ localized_strings->SetString("tools_menu",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_TOOLS_MENU));
+ localized_strings->SetString("import_menu",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_IMPORT_MENU));
+ localized_strings->SetString("export_menu",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_EXPORT_MENU));
+ localized_strings->SetString("rename_folder",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_RENAME_FOLDER));
+ localized_strings->SetString("edit",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_EDIT));
+ localized_strings->SetString("should_open_all",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL));
+ localized_strings->SetString("open_incognito",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OPEN_INCOGNITO));
+ localized_strings->SetString("open_in_new_tab",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OPEN_IN_NEW_TAB));
+ localized_strings->SetString("open_in_new_window",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OPEN_IN_NEW_WINDOW));
+ localized_strings->SetString("add_new_bookmark",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_ADD_NEW_BOOKMARK));
+ localized_strings->SetString("new_folder",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_NEW_FOLDER));
+ localized_strings->SetString("open_all",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OPEN_ALL));
+ localized_strings->SetString("open_all_new_window",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW));
+ localized_strings->SetString("open_all_incognito",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OPEN_ALL_INCOGNITO));
+ localized_strings->SetString("remove",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_REMOVE));
+ localized_strings->SetString("copy",
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_COPY));
+ localized_strings->SetString("cut",
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_CUT));
+ localized_strings->SetString("paste",
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PASTE));
+ localized_strings->SetString("delete",
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_DELETE));
+ localized_strings->SetString("new_folder_name",
+ l10n_util::GetStringUTF16(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME));
+ localized_strings->SetString("name_input_placeholder",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_NAME_INPUT_PLACE_HOLDER));
+ localized_strings->SetString("url_input_placeholder",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_URL_INPUT_PLACE_HOLDER));
+ localized_strings->SetString("invalid_url",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_INVALID_URL));
+ localized_strings->SetString("recent",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_RECENT));
+ localized_strings->SetString("search",
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SEARCH));
ChromeURLDataManager::DataSource::SetFontAndTextDirection(localized_strings);
diff --git a/chrome/browser/extensions/extension_browser_actions_api.cc b/chrome/browser/extensions/extension_browser_actions_api.cc
index dfcf2ad..fd251f7 100644
--- a/chrome/browser/extensions/extension_browser_actions_api.cc
+++ b/chrome/browser/extensions/extension_browser_actions_api.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -22,8 +22,8 @@ bool BrowserActionFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details_));
EXTENSION_FUNCTION_VALIDATE(details_ != NULL);
- if (details_->HasKey(L"tabId"))
- EXTENSION_FUNCTION_VALIDATE(details_->GetInteger(L"tabId", &tab_id_));
+ if (details_->HasKey("tabId"))
+ EXTENSION_FUNCTION_VALIDATE(details_->GetInteger("tabId", &tab_id_));
Extension* extension = GetExtension();
browser_action_ = extension->browser_action();
@@ -44,7 +44,7 @@ bool BrowserActionFunction::RunImpl() {
bool BrowserActionSetIconFunction::RunBrowserAction() {
BinaryValue* binary = NULL;
- EXTENSION_FUNCTION_VALIDATE(details_->GetBinary(L"imageData", &binary));
+ EXTENSION_FUNCTION_VALIDATE(details_->GetBinary("imageData", &binary));
IPC::Message bitmap_pickle(binary->GetBuffer(), binary->GetSize());
void* iter = NULL;
SkBitmap bitmap;
@@ -56,14 +56,14 @@ bool BrowserActionSetIconFunction::RunBrowserAction() {
bool BrowserActionSetTitleFunction::RunBrowserAction() {
std::string title;
- EXTENSION_FUNCTION_VALIDATE(details_->GetString(L"title", &title));
+ EXTENSION_FUNCTION_VALIDATE(details_->GetString("title", &title));
browser_action_->SetTitle(tab_id_, title);
return true;
}
bool BrowserActionSetPopupFunction::RunBrowserAction() {
std::string popup_string;
- EXTENSION_FUNCTION_VALIDATE(details_->GetString(L"popup", &popup_string));
+ EXTENSION_FUNCTION_VALIDATE(details_->GetString("popup", &popup_string));
GURL popup_url;
if (!popup_string.empty())
@@ -75,14 +75,14 @@ bool BrowserActionSetPopupFunction::RunBrowserAction() {
bool BrowserActionSetBadgeTextFunction::RunBrowserAction() {
std::string badge_text;
- EXTENSION_FUNCTION_VALIDATE(details_->GetString(L"text", &badge_text));
+ EXTENSION_FUNCTION_VALIDATE(details_->GetString("text", &badge_text));
browser_action_->SetBadgeText(tab_id_, badge_text);
return true;
}
bool BrowserActionSetBadgeBackgroundColorFunction::RunBrowserAction() {
ListValue* list = NULL;
- EXTENSION_FUNCTION_VALIDATE(details_->GetList(L"color", &list));
+ EXTENSION_FUNCTION_VALIDATE(details_->GetList("color", &list));
EXTENSION_FUNCTION_VALIDATE(list->GetSize() == 4);
int color_array[4] = {0};
diff --git a/chrome/browser/extensions/extension_menu_manager.cc b/chrome/browser/extensions/extension_menu_manager.cc
index 387e73e..77c3408 100644
--- a/chrome/browser/extensions/extension_menu_manager.cc
+++ b/chrome/browser/extensions/extension_menu_manager.cc
@@ -363,7 +363,7 @@ void ExtensionMenuManager::RadioItemSelected(ExtensionMenuItem* item) {
}
static void AddURLProperty(DictionaryValue* dictionary,
- const std::wstring& key, const GURL& url) {
+ const std::string& key, const GURL& url) {
if (!url.is_empty())
dictionary->SetString(key, url.possibly_invalid_spec());
}
@@ -387,32 +387,33 @@ void ExtensionMenuManager::ExecuteCommand(
ListValue args;
DictionaryValue* properties = new DictionaryValue();
- properties->SetInteger(L"menuItemId", item->id().second);
+ properties->SetInteger("menuItemId", item->id().second);
if (item->parent_id())
- properties->SetInteger(L"parentMenuItemId", item->parent_id()->second);
+ properties->SetInteger("parentMenuItemId", item->parent_id()->second);
switch (params.media_type) {
case WebKit::WebContextMenuData::MediaTypeImage:
- properties->SetString(L"mediaType", "image");
+ properties->SetString("mediaType", "image");
break;
case WebKit::WebContextMenuData::MediaTypeVideo:
- properties->SetString(L"mediaType", "video");
+ properties->SetString("mediaType", "video");
break;
case WebKit::WebContextMenuData::MediaTypeAudio:
- properties->SetString(L"mediaType", "audio");
+ properties->SetString("mediaType", "audio");
break;
default: {} // Do nothing.
}
- AddURLProperty(properties, L"linkUrl", params.unfiltered_link_url);
- AddURLProperty(properties, L"srcUrl", params.src_url);
- AddURLProperty(properties, L"pageUrl", params.page_url);
- AddURLProperty(properties, L"frameUrl", params.frame_url);
+ AddURLProperty(properties, "linkUrl", params.unfiltered_link_url);
+ AddURLProperty(properties, "srcUrl", params.src_url);
+ AddURLProperty(properties, "pageUrl", params.page_url);
+ AddURLProperty(properties, "frameUrl", params.frame_url);
if (params.selection_text.length() > 0)
- properties->SetString(L"selectionText", params.selection_text);
+ properties->SetString("selectionText",
+ WideToUTF16Hack(params.selection_text));
- properties->SetBoolean(L"editable", params.is_editable);
+ properties->SetBoolean("editable", params.is_editable);
args.Append(properties);
@@ -426,7 +427,7 @@ void ExtensionMenuManager::ExecuteCommand(
if (item->type() == ExtensionMenuItem::CHECKBOX ||
item->type() == ExtensionMenuItem::RADIO) {
bool was_checked = item->checked();
- properties->SetBoolean(L"wasChecked", was_checked);
+ properties->SetBoolean("wasChecked", was_checked);
// RADIO items always get set to true when you click on them, but CHECKBOX
// items get their state toggled.
@@ -434,7 +435,7 @@ void ExtensionMenuManager::ExecuteCommand(
(item->type() == ExtensionMenuItem::RADIO) ? true : !was_checked;
item->SetChecked(checked);
- properties->SetBoolean(L"checked", item->checked());
+ properties->SetBoolean("checked", item->checked());
}
std::string json_args;
diff --git a/chrome/browser/extensions/extension_menu_manager_unittest.cc b/chrome/browser/extensions/extension_menu_manager_unittest.cc
index 4955930..c0ad8d9 100644
--- a/chrome/browser/extensions/extension_menu_manager_unittest.cc
+++ b/chrome/browser/extensions/extension_menu_manager_unittest.cc
@@ -443,22 +443,21 @@ TEST_F(ExtensionMenuManagerTest, ExecuteCommand) {
ASSERT_TRUE(list->GetDictionary(0, &info));
int tmp_id = 0;
- ASSERT_TRUE(info->GetInteger(L"menuItemId", &tmp_id));
+ ASSERT_TRUE(info->GetInteger("menuItemId", &tmp_id));
ASSERT_EQ(id.second, tmp_id);
std::string tmp;
- ASSERT_TRUE(info->GetString(L"mediaType", &tmp));
+ ASSERT_TRUE(info->GetString("mediaType", &tmp));
ASSERT_EQ("image", tmp);
- ASSERT_TRUE(info->GetString(L"srcUrl", &tmp));
+ ASSERT_TRUE(info->GetString("srcUrl", &tmp));
ASSERT_EQ(params.src_url.spec(), tmp);
- ASSERT_TRUE(info->GetString(L"pageUrl", &tmp));
+ ASSERT_TRUE(info->GetString("pageUrl", &tmp));
ASSERT_EQ(params.page_url.spec(), tmp);
- std::wstring wide_tmp;
- ASSERT_TRUE(info->GetString(L"selectionText", &wide_tmp));
- ASSERT_EQ(params.selection_text, wide_tmp);
+ ASSERT_TRUE(info->GetString("selectionText", &tmp));
+ ASSERT_EQ(WideToUTF8(params.selection_text), tmp);
bool bool_tmp = true;
- ASSERT_TRUE(info->GetBoolean(L"editable", &bool_tmp));
+ ASSERT_TRUE(info->GetBoolean("editable", &bool_tmp));
ASSERT_EQ(params.is_editable, bool_tmp);
}
diff --git a/chrome/browser/extensions/extension_metrics_module.cc b/chrome/browser/extensions/extension_metrics_module.cc
index 380cf0af..4368c86 100644
--- a/chrome/browser/extensions/extension_metrics_module.cc
+++ b/chrome/browser/extensions/extension_metrics_module.cc
@@ -82,11 +82,11 @@ bool MetricsRecordValueFunction::RunImpl() {
int min;
int max;
int buckets;
- EXTENSION_FUNCTION_VALIDATE(metric_type->GetString(L"metricName", &name));
- EXTENSION_FUNCTION_VALIDATE(metric_type->GetString(L"type", &type));
- EXTENSION_FUNCTION_VALIDATE(metric_type->GetInteger(L"min", &min));
- EXTENSION_FUNCTION_VALIDATE(metric_type->GetInteger(L"max", &max));
- EXTENSION_FUNCTION_VALIDATE(metric_type->GetInteger(L"buckets", &buckets));
+ EXTENSION_FUNCTION_VALIDATE(metric_type->GetString("metricName", &name));
+ EXTENSION_FUNCTION_VALIDATE(metric_type->GetString("type", &type));
+ EXTENSION_FUNCTION_VALIDATE(metric_type->GetInteger("min", &min));
+ EXTENSION_FUNCTION_VALIDATE(metric_type->GetInteger("max", &max));
+ EXTENSION_FUNCTION_VALIDATE(metric_type->GetInteger("buckets", &buckets));
Histogram::ClassType histogram_type(type == "histogram-linear" ?
Histogram::LINEAR_HISTOGRAM : Histogram::HISTOGRAM);
diff --git a/chrome/browser/extensions/extension_page_actions_module.cc b/chrome/browser/extensions/extension_page_actions_module.cc
index 095cd36..86426ee 100644
--- a/chrome/browser/extensions/extension_page_actions_module.cc
+++ b/chrome/browser/extensions/extension_page_actions_module.cc
@@ -144,7 +144,7 @@ bool PageActionSetIconFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args));
int tab_id;
- EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
+ EXTENSION_FUNCTION_VALIDATE(args->GetInteger("tabId", &tab_id));
if (!InitCommon(tab_id))
return false;
@@ -152,14 +152,14 @@ bool PageActionSetIconFunction::RunImpl() {
// icon index.
BinaryValue* binary;
int icon_index;
- if (args->GetBinary(L"imageData", &binary)) {
+ if (args->GetBinary("imageData", &binary)) {
IPC::Message bitmap_pickle(binary->GetBuffer(), binary->GetSize());
void* iter = NULL;
scoped_ptr<SkBitmap> bitmap(new SkBitmap);
EXTENSION_FUNCTION_VALIDATE(
IPC::ReadParam(&bitmap_pickle, &iter, bitmap.get()));
page_action_->SetIcon(tab_id, *bitmap);
- } else if (args->GetInteger(L"iconIndex", &icon_index)) {
+ } else if (args->GetInteger("iconIndex", &icon_index)) {
if (icon_index < 0 || static_cast<size_t>(icon_index) >=
page_action_->icon_paths()->size()) {
error_ = kIconIndexOutOfBounds;
@@ -180,12 +180,12 @@ bool PageActionSetTitleFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args));
int tab_id;
- EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
+ EXTENSION_FUNCTION_VALIDATE(args->GetInteger("tabId", &tab_id));
if (!InitCommon(tab_id))
return false;
std::string title;
- EXTENSION_FUNCTION_VALIDATE(args->GetString(L"title", &title));
+ EXTENSION_FUNCTION_VALIDATE(args->GetString("title", &title));
page_action_->SetTitle(tab_id, title);
contents_->PageActionStateChanged();
@@ -197,14 +197,14 @@ bool PageActionSetPopupFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args));
int tab_id;
- EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
+ EXTENSION_FUNCTION_VALIDATE(args->GetInteger("tabId", &tab_id));
if (!InitCommon(tab_id))
return false;
// TODO(skerner): Consider allowing null and undefined to mean the popup
// should be removed.
std::string popup_string;
- EXTENSION_FUNCTION_VALIDATE(args->GetString(L"popup", &popup_string));
+ EXTENSION_FUNCTION_VALIDATE(args->GetString("popup", &popup_string));
GURL popup_url;
if (!popup_string.empty())
@@ -222,12 +222,12 @@ bool PageActionSetBadgeBackgroundColorFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args));
int tab_id;
- EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
+ EXTENSION_FUNCTION_VALIDATE(args->GetInteger("tabId", &tab_id));
if (!InitCommon(tab_id))
return false;
ListValue* color_value;
- EXTENSION_FUNCTION_VALIDATE(args->GetList(L"color", &color_value));
+ EXTENSION_FUNCTION_VALIDATE(args->GetList("color", &color_value));
EXTENSION_FUNCTION_VALIDATE(color_value->GetSize() == 4);
int color_array[4] = {0};
@@ -248,12 +248,12 @@ bool PageActionSetBadgeTextColorFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args));
int tab_id;
- EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
+ EXTENSION_FUNCTION_VALIDATE(args->GetInteger("tabId", &tab_id));
if (!InitCommon(tab_id))
return false;
ListValue* color_value;
- EXTENSION_FUNCTION_VALIDATE(args->GetList(L"color", &color_value));
+ EXTENSION_FUNCTION_VALIDATE(args->GetList("color", &color_value));
EXTENSION_FUNCTION_VALIDATE(color_value->GetSize() == 4);
int color_array[4] = {0};
@@ -274,12 +274,12 @@ bool PageActionSetBadgeTextFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args));
int tab_id;
- EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
+ EXTENSION_FUNCTION_VALIDATE(args->GetInteger("tabId", &tab_id));
if (!InitCommon(tab_id))
return false;
std::string text;
- EXTENSION_FUNCTION_VALIDATE(args->GetString(L"text", &text));
+ EXTENSION_FUNCTION_VALIDATE(args->GetString("text", &text));
page_action_->SetBadgeText(tab_id, text);
contents_->PageActionStateChanged();
diff --git a/chrome/browser/extensions/extension_proxy_api.cc b/chrome/browser/extensions/extension_proxy_api.cc
index 053b0fe..1e9ba78 100644
--- a/chrome/browser/extensions/extension_proxy_api.cc
+++ b/chrome/browser/extensions/extension_proxy_api.cc
@@ -25,19 +25,20 @@ enum {
// The names of the JavaScript properties to extract from the args_.
// These must be kept in sync with the SCHEME_* constants.
-static const std::wstring field_name[] = {L"singleProxy",
- L"proxyForHttp",
- L"proxyForHttps",
- L"proxyForFtp",
- L"socksProxy"};
+const char* field_name[] = { "singleProxy",
+ "proxyForHttp",
+ "proxyForHttps",
+ "proxyForFtp",
+ "socksProxy" };
// The names of the schemes to be used to build the preference value string.
// These must be kept in sync with the SCHEME_* constants.
-static const std::string scheme_name[] = {"*error*",
- "http",
- "https",
- "ftp",
- "socks"};
+const char* scheme_name[] = { "*error*",
+ "http",
+ "https",
+ "ftp",
+ "socks" };
+
} // namespace
COMPILE_ASSERT(SCHEME_MAX == SCHEME_SOCKS, SCHEME_MAX_must_equal_SCHEME_SOCKS);
@@ -51,7 +52,7 @@ bool UseCustomProxySettingsFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &proxy_config));
DictionaryValue* proxy_rules;
- EXTENSION_FUNCTION_VALIDATE(proxy_config->GetDictionary(L"rules",
+ EXTENSION_FUNCTION_VALIDATE(proxy_config->GetDictionary("rules",
&proxy_rules));
// Local data into which the parameters will be parsed. has_proxy describes
@@ -121,8 +122,8 @@ bool UseCustomProxySettingsFunction::RunImpl() {
bool UseCustomProxySettingsFunction::GetProxyServer(
const DictionaryValue* dict, ProxyServer* proxy_server) {
- dict->GetString(L"scheme", &proxy_server->scheme);
- EXTENSION_FUNCTION_VALIDATE(dict->GetString(L"host", &proxy_server->host));
- dict->GetInteger(L"port", &proxy_server->port);
+ dict->GetString("scheme", &proxy_server->scheme);
+ EXTENSION_FUNCTION_VALIDATE(dict->GetString("host", &proxy_server->host));
+ dict->GetInteger("port", &proxy_server->port);
return true;
}
diff --git a/chrome/browser/extensions/external_pref_extension_provider.cc b/chrome/browser/extensions/external_pref_extension_provider.cc
index bd93a72..8bcd891 100644
--- a/chrome/browser/extensions/external_pref_extension_provider.cc
+++ b/chrome/browser/extensions/external_pref_extension_provider.cc
@@ -104,11 +104,10 @@ void ExternalPrefExtensionProvider::SetPreferences(
Value* extensions = serializer->Deserialize(NULL, &error_msg);
scoped_ptr<DictionaryValue> dictionary(new DictionaryValue());
if (!extensions) {
- LOG(WARNING) << L"Unable to deserialize json data: "
- << error_msg;
+ LOG(WARNING) << "Unable to deserialize json data: " << error_msg;
} else {
if (!extensions->IsType(Value::TYPE_DICTIONARY)) {
- NOTREACHED() << L"Invalid json data";
+ NOTREACHED() << "Invalid json data";
} else {
dictionary.reset(static_cast<DictionaryValue*>(extensions));
}