summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 04:00:57 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 04:00:57 +0000
commita65175d452e6cb3c9c3599ab4206c42b8ab78bfd (patch)
treeae69bde6df9080e4e367c23bba9096a1bf302c60 /chrome
parentd9e0c26a9c2850d42c4de6b2f981a8da56497c2c (diff)
downloadchromium_src-a65175d452e6cb3c9c3599ab4206c42b8ab78bfd.zip
chromium_src-a65175d452e6cb3c9c3599ab4206c42b8ab78bfd.tar.gz
chromium_src-a65175d452e6cb3c9c3599ab4206c42b8ab78bfd.tar.bz2
Remove deprecated wstring DictionaryValue Get{Boolean,Integer,Real,Binary,Dictionary,List}().
BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3187004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc4
-rw-r--r--chrome/browser/autocomplete/search_provider.cc2
-rw-r--r--chrome/browser/chromeos/external_protocol_dialog.cc4
-rw-r--r--chrome/browser/chromeos/external_protocol_dialog.h4
-rw-r--r--chrome/browser/chromeos/login/user_image_downloader.cc8
-rw-r--r--chrome/browser/cocoa/external_protocol_dialog.mm8
-rw-r--r--chrome/browser/extensions/extension_dom_ui.cc4
-rw-r--r--chrome/browser/extensions/extension_prefs.cc2
-rw-r--r--chrome/browser/extensions/external_pref_extension_provider.cc2
-rw-r--r--chrome/browser/external_protocol_handler.cc45
-rw-r--r--chrome/browser/external_protocol_handler.h4
-rw-r--r--chrome/browser/gtk/external_protocol_dialog_gtk.cc6
-rw-r--r--chrome/browser/gtk/task_manager_gtk.cc18
-rw-r--r--chrome/browser/importer/firefox_proxy_settings.cc14
-rw-r--r--chrome/browser/printing/print_dialog_cloud.cc10
-rw-r--r--chrome/browser/translate/translate_prefs.cc21
-rw-r--r--chrome/browser/views/external_protocol_dialog.cc6
-rw-r--r--chrome/installer/util/util_constants.cc4
-rw-r--r--chrome/installer/util/util_constants.h4
19 files changed, 84 insertions, 86 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 84d485b..9a2508b 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -12,6 +12,7 @@
#include "base/i18n/number_formatting.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete/history_quick_provider.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
#include "chrome/browser/autocomplete/history_contents_provider.h"
@@ -157,7 +158,8 @@ AutocompleteInput::Type AutocompleteInput::Parse(
// a URL before. We need to do this last because some schemes may be in
// here as "blocked" (e.g. "javascript") because we don't want pages to open
// them, but users still can.
- switch (ExternalProtocolHandler::GetBlockState(parsed_scheme)) {
+ // TODO(viettrungluu): get rid of conversion.
+ switch (ExternalProtocolHandler::GetBlockState(WideToUTF8(parsed_scheme))) {
case ExternalProtocolHandler::DONT_BLOCK:
return URL;
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 6d3016c..7fc30ee 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -429,7 +429,7 @@ bool SearchProvider::ParseSuggestResults(Value* root_val,
DictionaryValue* dict_val = static_cast<DictionaryValue*>(optional_val);
// Parse Google Suggest specific type extension.
- static const std::wstring kGoogleSuggestType(L"google:suggesttype");
+ static const std::string kGoogleSuggestType("google:suggesttype");
if (dict_val->HasKey(kGoogleSuggestType))
dict_val->GetList(kGoogleSuggestType, &type_list);
}
diff --git a/chrome/browser/chromeos/external_protocol_dialog.cc b/chrome/browser/chromeos/external_protocol_dialog.cc
index 5aeb8a9..2c53a29 100644
--- a/chrome/browser/chromeos/external_protocol_dialog.cc
+++ b/chrome/browser/chromeos/external_protocol_dialog.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.
@@ -82,7 +82,7 @@ views::View* ExternalProtocolDialog::GetContentsView() {
ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents,
const GURL& url)
: creation_time_(base::TimeTicks::Now()),
- scheme_(UTF8ToWide(url.scheme())) {
+ scheme_(url.scheme()) {
const int kMaxUrlWithoutSchemeSize = 256;
std::wstring elided_url_without_scheme;
ElideString(ASCIIToWide(url.possibly_invalid_spec()),
diff --git a/chrome/browser/chromeos/external_protocol_dialog.h b/chrome/browser/chromeos/external_protocol_dialog.h
index dc598de..84f7955 100644
--- a/chrome/browser/chromeos/external_protocol_dialog.h
+++ b/chrome/browser/chromeos/external_protocol_dialog.h
@@ -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.
@@ -44,7 +44,7 @@ class ExternalProtocolDialog : public views::DialogDelegate {
base::TimeTicks creation_time_;
// The scheme of the url.
- std::wstring scheme_;
+ std::string scheme_;
DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog);
};
diff --git a/chrome/browser/chromeos/login/user_image_downloader.cc b/chrome/browser/chromeos/login/user_image_downloader.cc
index 490ca77..c5b40bb 100644
--- a/chrome/browser/chromeos/login/user_image_downloader.cc
+++ b/chrome/browser/chromeos/login/user_image_downloader.cc
@@ -109,11 +109,11 @@ bool UserImageDownloader::GetImageURL(const std::string& json_data,
DictionaryValue* root_dictionary =
static_cast<DictionaryValue*>(root.get());
DictionaryValue* feed_dictionary = NULL;
- if (!root_dictionary->GetDictionary(L"feed", &feed_dictionary))
+ if (!root_dictionary->GetDictionary("feed", &feed_dictionary))
return false;
ListValue* entry_list = NULL;
- if (!feed_dictionary->GetList(L"entry", &entry_list))
+ if (!feed_dictionary->GetList("entry", &entry_list))
return false;
return GetImageURLFromEntries(entry_list, image_url);
@@ -129,7 +129,7 @@ bool UserImageDownloader::GetImageURLFromEntries(ListValue* entry_list,
continue;
ListValue* email_list = NULL;
- if (!entry_dictionary->GetList(L"gd$email", &email_list))
+ if (!entry_dictionary->GetList("gd$email", &email_list))
continue;
// Match entry email address to understand that this is user's entry.
@@ -137,7 +137,7 @@ bool UserImageDownloader::GetImageURLFromEntries(ListValue* entry_list,
continue;
ListValue* link_list = NULL;
- if (!entry_dictionary->GetList(L"link", &link_list))
+ if (!entry_dictionary->GetList("link", &link_list))
continue;
if (GetImageURLFromLinks(link_list, image_url))
diff --git a/chrome/browser/cocoa/external_protocol_dialog.mm b/chrome/browser/cocoa/external_protocol_dialog.mm
index dc3ca24..3a7849a 100644
--- a/chrome/browser/cocoa/external_protocol_dialog.mm
+++ b/chrome/browser/cocoa/external_protocol_dialog.mm
@@ -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.
@@ -116,10 +116,8 @@ void ExternalProtocolHandler::RunExternalProtocolDialog(
}
// Set the "don't warn me again" info.
- if ([[alert_ suppressionButton] state] == NSOnState) {
- ExternalProtocolHandler::SetBlockState(UTF8ToWide(url_.scheme()),
- blockState);
- }
+ if ([[alert_ suppressionButton] state] == NSOnState)
+ ExternalProtocolHandler::SetBlockState(url_.scheme(), blockState);
if (blockState == ExternalProtocolHandler::DONT_BLOCK) {
UMA_HISTOGRAM_LONG_TIMES("clickjacking.launch_url",
diff --git a/chrome/browser/extensions/extension_dom_ui.cc b/chrome/browser/extensions/extension_dom_ui.cc
index 29768b9..a6b6fc6 100644
--- a/chrome/browser/extensions/extension_dom_ui.cc
+++ b/chrome/browser/extensions/extension_dom_ui.cc
@@ -225,7 +225,7 @@ bool ExtensionDOMUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
profile->GetPrefs()->GetDictionary(kExtensionURLOverrides);
std::string page = url->host();
ListValue* url_list;
- if (!overrides || !overrides->GetList(UTF8ToWide(page), &url_list))
+ if (!overrides || !overrides->GetList(page, &url_list))
return false;
ExtensionsService* service = profile->GetExtensionsService();
@@ -348,7 +348,7 @@ void ExtensionDOMUI::UnregisterChromeURLOverride(const std::string& page,
DictionaryValue* all_overrides =
prefs->GetMutableDictionary(kExtensionURLOverrides);
ListValue* page_overrides;
- if (!all_overrides->GetList(UTF8ToWide(page), &page_overrides)) {
+ if (!all_overrides->GetList(page, &page_overrides)) {
// If it's being unregistered, it should already be in the list.
NOTREACHED();
return;
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index c33ea33..9b28456 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -222,7 +222,7 @@ bool ExtensionPrefs::ReadExtensionPrefBoolean(
return false;
DictionaryValue* ext = NULL;
- if (!extensions->GetDictionary(ASCIIToWide(extension_id), &ext)) {
+ if (!extensions->GetDictionary(extension_id, &ext)) {
// No such extension yet.
return false;
}
diff --git a/chrome/browser/extensions/external_pref_extension_provider.cc b/chrome/browser/extensions/external_pref_extension_provider.cc
index 8bcd891..d9b2748 100644
--- a/chrome/browser/extensions/external_pref_extension_provider.cc
+++ b/chrome/browser/extensions/external_pref_extension_provider.cc
@@ -86,7 +86,7 @@ void ExternalPrefExtensionProvider::VisitRegisteredExtension(
Version* ExternalPrefExtensionProvider::RegisteredVersion(
const std::string& id, Extension::Location* location) const {
DictionaryValue* extension = NULL;
- if (!prefs_->GetDictionary(ASCIIToWide(id), &extension))
+ if (!prefs_->GetDictionary(id, &extension))
return NULL;
std::string external_version;
diff --git a/chrome/browser/external_protocol_handler.cc b/chrome/browser/external_protocol_handler.cc
index 2172394..9718fd8 100644
--- a/chrome/browser/external_protocol_handler.cc
+++ b/chrome/browser/external_protocol_handler.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 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.
@@ -12,7 +12,6 @@
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/thread.h"
-#include "base/utf_string_conversions.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/platform_util.h"
@@ -33,33 +32,33 @@ void ExternalProtocolHandler::PrepopulateDictionary(DictionaryValue* win_pref) {
return;
is_warm = true;
- static const wchar_t* const denied_schemes[] = {
- L"afp",
- L"data",
- L"disk",
- L"disks",
+ static const char* const denied_schemes[] = {
+ "afp",
+ "data",
+ "disk",
+ "disks",
// ShellExecuting file:///C:/WINDOWS/system32/notepad.exe will simply
// execute the file specified! Hopefully we won't see any "file" schemes
// because we think of file:// URLs as handled URLs, but better to be safe
// than to let an attacker format the user's hard drive.
- L"file",
- L"hcp",
- L"javascript",
- L"ms-help",
- L"nntp",
- L"shell",
- L"vbscript",
+ "file",
+ "hcp",
+ "javascript",
+ "ms-help",
+ "nntp",
+ "shell",
+ "vbscript",
// view-source is a special case in chrome. When it comes through an
// iframe or a redirect, it looks like an external protocol, but we don't
// want to shellexecute it.
- L"view-source",
- L"vnd.ms.radio",
+ "view-source",
+ "vnd.ms.radio",
};
- static const wchar_t* const allowed_schemes[] = {
- L"mailto",
- L"news",
- L"snews",
+ static const char* const allowed_schemes[] = {
+ "mailto",
+ "news",
+ "snews",
};
bool should_block;
@@ -78,7 +77,7 @@ void ExternalProtocolHandler::PrepopulateDictionary(DictionaryValue* win_pref) {
// static
ExternalProtocolHandler::BlockState ExternalProtocolHandler::GetBlockState(
- const std::wstring& scheme) {
+ const std::string& scheme) {
// If we are being carpet bombed, block the request.
if (!g_accept_requests)
return BLOCK;
@@ -111,7 +110,7 @@ ExternalProtocolHandler::BlockState ExternalProtocolHandler::GetBlockState(
}
// static
-void ExternalProtocolHandler::SetBlockState(const std::wstring& scheme,
+void ExternalProtocolHandler::SetBlockState(const std::string& scheme,
BlockState state) {
// Set in the stored prefs.
// TODO(pkasting): http://b/1119651 This kind of thing should go in the
@@ -139,7 +138,7 @@ void ExternalProtocolHandler::LaunchUrl(const GURL& url,
// have parameters unexpected by the external program.
std::string escaped_url_string = EscapeExternalHandlerValue(url.spec());
GURL escaped_url(escaped_url_string);
- BlockState block_state = GetBlockState(ASCIIToWide(escaped_url.scheme()));
+ BlockState block_state = GetBlockState(escaped_url.scheme());
if (block_state == BLOCK)
return;
diff --git a/chrome/browser/external_protocol_handler.h b/chrome/browser/external_protocol_handler.h
index 6643da8..f822cc8 100644
--- a/chrome/browser/external_protocol_handler.h
+++ b/chrome/browser/external_protocol_handler.h
@@ -21,10 +21,10 @@ class ExternalProtocolHandler {
};
// Returns whether we should block a given scheme.
- static BlockState GetBlockState(const std::wstring& scheme);
+ static BlockState GetBlockState(const std::string& scheme);
// Sets whether we should block a given scheme.
- static void SetBlockState(const std::wstring& scheme, BlockState state);
+ static void SetBlockState(const std::string& scheme, BlockState state);
// Checks to see if the protocol is allowed, if it is whitelisted,
// the application associated with the protocol is launched on the io thread,
diff --git a/chrome/browser/gtk/external_protocol_dialog_gtk.cc b/chrome/browser/gtk/external_protocol_dialog_gtk.cc
index 2530d5b..2819fbb 100644
--- a/chrome/browser/gtk/external_protocol_dialog_gtk.cc
+++ b/chrome/browser/gtk/external_protocol_dialog_gtk.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.
@@ -113,10 +113,10 @@ void ExternalProtocolDialogGtk::OnDialogResponse(GtkWidget* widget,
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox_))) {
if (response == GTK_RESPONSE_ACCEPT) {
ExternalProtocolHandler::SetBlockState(
- UTF8ToWide(url_.scheme()), ExternalProtocolHandler::DONT_BLOCK);
+ url_.scheme(), ExternalProtocolHandler::DONT_BLOCK);
} else if (response == GTK_RESPONSE_REJECT) {
ExternalProtocolHandler::SetBlockState(
- UTF8ToWide(url_.scheme()), ExternalProtocolHandler::BLOCK);
+ url_.scheme(), ExternalProtocolHandler::BLOCK);
}
// If the response is GTK_RESPONSE_DELETE, triggered by the user closing
// the dialog, do nothing.
diff --git a/chrome/browser/gtk/task_manager_gtk.cc b/chrome/browser/gtk/task_manager_gtk.cc
index b476655..0fd6e49 100644
--- a/chrome/browser/gtk/task_manager_gtk.cc
+++ b/chrome/browser/gtk/task_manager_gtk.cc
@@ -496,10 +496,10 @@ void TaskManagerGtk::SetInitialDialogSize() {
prefs::kTaskManagerWindowPlacement);
int top = 0, left = 0, bottom = 1, right = 1;
if (placement_pref &&
- placement_pref->GetInteger(L"top", &top) &&
- placement_pref->GetInteger(L"left", &left) &&
- placement_pref->GetInteger(L"bottom", &bottom) &&
- placement_pref->GetInteger(L"right", &right)) {
+ placement_pref->GetInteger("top", &top) &&
+ placement_pref->GetInteger("left", &left) &&
+ placement_pref->GetInteger("bottom", &bottom) &&
+ placement_pref->GetInteger("right", &right)) {
gtk_window_resize(GTK_WINDOW(dialog_),
std::max(1, right - left),
std::max(1, bottom - top));
@@ -822,11 +822,11 @@ void TaskManagerGtk::OnResponse(GtkWidget* dialog, gint response_id) {
prefs::kTaskManagerWindowPlacement);
// Note that we store left/top for consistency with Windows, but that we
// *don't* restore them.
- placement_pref->SetInteger(L"left", dialog_bounds.x());
- placement_pref->SetInteger(L"top", dialog_bounds.y());
- placement_pref->SetInteger(L"right", dialog_bounds.right());
- placement_pref->SetInteger(L"bottom", dialog_bounds.bottom());
- placement_pref->SetBoolean(L"maximized", false);
+ placement_pref->SetInteger("left", dialog_bounds.x());
+ placement_pref->SetInteger("top", dialog_bounds.y());
+ placement_pref->SetInteger("right", dialog_bounds.right());
+ placement_pref->SetInteger("bottom", dialog_bounds.bottom());
+ placement_pref->SetBoolean("maximized", false);
}
instance_ = NULL;
diff --git a/chrome/browser/importer/firefox_proxy_settings.cc b/chrome/browser/importer/firefox_proxy_settings.cc
index 9c3166b..55ccc3e 100644
--- a/chrome/browser/importer/firefox_proxy_settings.cc
+++ b/chrome/browser/importer/firefox_proxy_settings.cc
@@ -12,18 +12,18 @@
namespace {
-const wchar_t* const kNetworkProxyTypeKey = L"network.proxy.type";
+const char* const kNetworkProxyTypeKey = "network.proxy.type";
const char* const kHTTPProxyKey = "network.proxy.http";
-const wchar_t* const kHTTPProxyPortKey = L"network.proxy.http_port";
+const char* const kHTTPProxyPortKey = "network.proxy.http_port";
const char* const kSSLProxyKey = "network.proxy.ssl";
-const wchar_t* const kSSLProxyPortKey = L"network.proxy.ssl_port";
+const char* const kSSLProxyPortKey = "network.proxy.ssl_port";
const char* const kFTPProxyKey = "network.proxy.ftp";
-const wchar_t* const kFTPProxyPortKey = L"network.proxy.ftp_port";
+const char* const kFTPProxyPortKey = "network.proxy.ftp_port";
const char* const kGopherProxyKey = "network.proxy.gopher";
-const wchar_t* const kGopherProxyPortKey = L"network.proxy.gopher_port";
+const char* const kGopherProxyPortKey = "network.proxy.gopher_port";
const char* const kSOCKSHostKey = "network.proxy.socks";
-const wchar_t* const kSOCKSHostPortKey = L"network.proxy.socks_port";
-const wchar_t* const kSOCKSVersionKey = L"network.proxy.socks_version";
+const char* const kSOCKSHostPortKey = "network.proxy.socks_port";
+const char* const kSOCKSVersionKey = "network.proxy.socks_version";
const char* const kAutoconfigURL = "network.proxy.autoconfig_url";
const char* const kNoProxyListKey = "network.proxy.no_proxies_on";
const char* const kPrefFileName = "prefs.js";
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 8e7a839..368d25b 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -137,7 +137,7 @@ GURL CloudPrintService::GetCloudPrintServiceDialogURL() {
}
bool GetRealOrInt(const DictionaryValue& dictionary,
- const std::wstring& path,
+ const std::string& path,
double* out_value) {
if (!dictionary.GetReal(path, out_value)) {
int int_value = 0;
@@ -161,10 +161,10 @@ bool GetPageSetupParameters(const std::string& json,
bool result = true;
DictionaryValue* params = static_cast<DictionaryValue*>(parsed_value.get());
- result &= GetRealOrInt(*params, L"dpi", &parameters.dpi);
- result &= GetRealOrInt(*params, L"min_shrink", &parameters.min_shrink);
- result &= GetRealOrInt(*params, L"max_shrink", &parameters.max_shrink);
- result &= params->GetBoolean(L"selection_only", &parameters.selection_only);
+ result &= GetRealOrInt(*params, "dpi", &parameters.dpi);
+ result &= GetRealOrInt(*params, "min_shrink", &parameters.min_shrink);
+ result &= GetRealOrInt(*params, "max_shrink", &parameters.max_shrink);
+ result &= params->GetBoolean("selection_only", &parameters.selection_only);
return result;
}
diff --git a/chrome/browser/translate/translate_prefs.cc b/chrome/browser/translate/translate_prefs.cc
index aa139b0..c815bee 100644
--- a/chrome/browser/translate/translate_prefs.cc
+++ b/chrome/browser/translate/translate_prefs.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/translate/translate_prefs.h"
#include "base/string_util.h"
-#include "base/utf_string_conversions.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/scoped_pref_update.h"
@@ -79,7 +78,7 @@ void TranslatePrefs::WhitelistLanguagePair(
return;
}
ScopedPrefUpdate update(prefs_, kPrefTranslateWhitelists);
- dict->SetString(ASCIIToWide(original_language), target_language);
+ dict->SetString(original_language, target_language);
prefs_->ScheduleSavePersistentPrefs();
}
@@ -93,7 +92,7 @@ void TranslatePrefs::RemoveLanguagePairFromWhitelist(
return;
}
ScopedPrefUpdate update(prefs_, kPrefTranslateWhitelists);
- if (dict->Remove(ASCIIToWide(original_language), NULL))
+ if (dict->Remove(original_language, NULL))
prefs_->ScheduleSavePersistentPrefs();
}
@@ -101,7 +100,7 @@ int TranslatePrefs::GetTranslationDeniedCount(const std::string& language) {
DictionaryValue* dict =
prefs_->GetMutableDictionary(kPrefTranslateDeniedCount);
int count = 0;
- return dict->GetInteger(UTF8ToWide(language), &count) ? count : 0;
+ return dict->GetInteger(language, &count) ? count : 0;
}
void TranslatePrefs::IncrementTranslationDeniedCount(
@@ -109,20 +108,20 @@ void TranslatePrefs::IncrementTranslationDeniedCount(
DictionaryValue* dict =
prefs_->GetMutableDictionary(kPrefTranslateDeniedCount);
int count = 0;
- dict->GetInteger(UTF8ToWide(language), &count);
- dict->SetInteger(UTF8ToWide(language), count + 1);
+ dict->GetInteger(language, &count);
+ dict->SetInteger(language, count + 1);
}
void TranslatePrefs::ResetTranslationDeniedCount(const std::string& language) {
prefs_->GetMutableDictionary(kPrefTranslateDeniedCount)->
- SetInteger(UTF8ToWide(language), 0);
+ SetInteger(language, 0);
}
int TranslatePrefs::GetTranslationAcceptedCount(const std::string& language) {
DictionaryValue* dict =
prefs_->GetMutableDictionary(kPrefTranslateAcceptedCount);
int count = 0;
- return dict->GetInteger(UTF8ToWide(language), &count) ? count : 0;
+ return dict->GetInteger(language, &count) ? count : 0;
}
void TranslatePrefs::IncrementTranslationAcceptedCount(
@@ -130,14 +129,14 @@ void TranslatePrefs::IncrementTranslationAcceptedCount(
DictionaryValue* dict =
prefs_->GetMutableDictionary(kPrefTranslateAcceptedCount);
int count = 0;
- dict->GetInteger(UTF8ToWide(language), &count);
- dict->SetInteger(UTF8ToWide(language), count + 1);
+ dict->GetInteger(language, &count);
+ dict->SetInteger(language, count + 1);
}
void TranslatePrefs::ResetTranslationAcceptedCount(
const std::string& language) {
prefs_->GetMutableDictionary(kPrefTranslateAcceptedCount)->
- SetInteger(UTF8ToWide(language), 0);
+ SetInteger(language, 0);
}
// TranslatePrefs: public, static: ---------------------------------------------
diff --git a/chrome/browser/views/external_protocol_dialog.cc b/chrome/browser/views/external_protocol_dialog.cc
index afaba70..9546f25 100644
--- a/chrome/browser/views/external_protocol_dialog.cc
+++ b/chrome/browser/views/external_protocol_dialog.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.
@@ -81,7 +81,7 @@ bool ExternalProtocolDialog::Cancel() {
// button.
if (message_box_view_->IsCheckBoxSelected()) {
ExternalProtocolHandler::SetBlockState(
- UTF8ToWide(url_.scheme()), ExternalProtocolHandler::BLOCK);
+ url_.scheme(), ExternalProtocolHandler::BLOCK);
}
// Returning true closes the dialog.
@@ -97,7 +97,7 @@ bool ExternalProtocolDialog::Accept() {
if (message_box_view_->IsCheckBoxSelected()) {
ExternalProtocolHandler::SetBlockState(
- UTF8ToWide(url_.scheme()), ExternalProtocolHandler::DONT_BLOCK);
+ url_.scheme(), ExternalProtocolHandler::DONT_BLOCK);
}
ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_);
diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc
index e6f62e2..e22d2c3 100644
--- a/chrome/installer/util/util_constants.cc
+++ b/chrome/installer/util/util_constants.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-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.
@@ -134,6 +134,6 @@ const wchar_t kSxSSuffix[] = L" SxS";
const wchar_t kUninstallStringField[] = L"UninstallString";
const wchar_t kUninstallArgumentsField[] = L"UninstallArguments";
const wchar_t kUninstallDisplayNameField[] = L"DisplayName";
-const wchar_t kUninstallMetricsName[] = L"uninstall_metrics";
+const char kUninstallMetricsName[] = "uninstall_metrics";
const wchar_t kUninstallInstallationDate[] = L"installation_date";
} // namespace installer_util
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index 8501c03..3a3d0f9 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-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.
//
@@ -101,7 +101,7 @@ extern const wchar_t kSxSSuffix[];
extern const wchar_t kUninstallStringField[];
extern const wchar_t kUninstallArgumentsField[];
extern const wchar_t kUninstallDisplayNameField[];
-extern const wchar_t kUninstallMetricsName[];
+extern const char kUninstallMetricsName[];
extern const wchar_t kUninstallInstallationDate[];
} // namespace installer_util