summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/importer/firefox_importer_unittest.cc30
-rw-r--r--chrome/browser/importer/firefox_importer_unittest_utils.h4
-rw-r--r--chrome/browser/importer/firefox_importer_unittest_utils_mac.cc2
-rw-r--r--chrome/browser/nacl_process_host.cc8
-rw-r--r--chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc6
-rw-r--r--chrome/browser/user_data_manager.cc15
-rw-r--r--chrome/browser/zygote_host_linux.cc2
-rw-r--r--chrome/test/ui/ui_test.cc7
8 files changed, 42 insertions, 32 deletions
diff --git a/chrome/browser/importer/firefox_importer_unittest.cc b/chrome/browser/importer/firefox_importer_unittest.cc
index e7e9470..fa5086c 100644
--- a/chrome/browser/importer/firefox_importer_unittest.cc
+++ b/chrome/browser/importer/firefox_importer_unittest.cc
@@ -19,21 +19,22 @@ using base::Time;
// to run in a separate process, so we use a proxy object so we can share the
// same test between platforms.
TEST(FirefoxImporterTest, Firefox2NSS3Decryptor) {
- std::wstring nss_path;
+ FilePath nss_path;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &nss_path));
#ifdef OS_MACOSX
- file_util::AppendToPath(&nss_path, L"firefox2_nss_mac");
+ nss_path = nss_path.AppendASCII("firefox2_nss_mac");
#else
- file_util::AppendToPath(&nss_path, L"firefox2_nss");
+ nss_path = nss_path.AppendASCII("firefox2_nss");
#endif // !OS_MACOSX
- std::wstring db_path;
+ FilePath db_path;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &db_path));
- file_util::AppendToPath(&db_path, L"firefox2_profile");
+ db_path = db_path.AppendASCII("firefox2_profile");
FFUnitTestDecryptorProxy decryptor_proxy;
- ASSERT_TRUE(decryptor_proxy.Setup(nss_path));
+ ASSERT_TRUE(decryptor_proxy.Setup(nss_path.ToWStringHack()));
- EXPECT_TRUE(decryptor_proxy.DecryptorInit(nss_path, db_path));
+ EXPECT_TRUE(decryptor_proxy.DecryptorInit(nss_path.ToWStringHack(),
+ db_path.ToWStringHack()));
EXPECT_EQ(L"hello", decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAE"
"wFAYIKoZIhvcNAwcECBJM63MpT9rtBAjMCm7qo/EhlA=="));
// Test UTF-16 encoding.
@@ -42,21 +43,22 @@ TEST(FirefoxImporterTest, Firefox2NSS3Decryptor) {
}
TEST(FirefoxImporterTest, Firefox3NSS3Decryptor) {
- std::wstring nss_path;
+ FilePath nss_path;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &nss_path));
#ifdef OS_MACOSX
- file_util::AppendToPath(&nss_path, L"firefox3_nss_mac");
+ nss_path = nss_path.AppendASCII("firefox3_nss_mac");
#else
- file_util::AppendToPath(&nss_path, L"firefox3_nss");
+ nss_path = nss_path.AppendASCII("firefox3_nss");
#endif // !OS_MACOSX
- std::wstring db_path;
+ FilePath db_path;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &db_path));
- file_util::AppendToPath(&db_path, L"firefox3_profile");
+ db_path = db_path.AppendASCII("firefox3_profile");
FFUnitTestDecryptorProxy decryptor_proxy;
- ASSERT_TRUE(decryptor_proxy.Setup(nss_path));
+ ASSERT_TRUE(decryptor_proxy.Setup(nss_path.ToWStringHack()));
- EXPECT_TRUE(decryptor_proxy.DecryptorInit(nss_path, db_path));
+ EXPECT_TRUE(decryptor_proxy.DecryptorInit(nss_path.ToWStringHack(),
+ db_path.ToWStringHack()));
EXPECT_EQ(L"hello", decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAE"
"wFAYIKoZIhvcNAwcECKajtRg4qFSHBAhv9luFkXgDJA=="));
// Test UTF-16 encoding.
diff --git a/chrome/browser/importer/firefox_importer_unittest_utils.h b/chrome/browser/importer/firefox_importer_unittest_utils.h
index cb53cce..c989bd6 100644
--- a/chrome/browser/importer/firefox_importer_unittest_utils.h
+++ b/chrome/browser/importer/firefox_importer_unittest_utils.h
@@ -34,7 +34,7 @@ class FFUnitTestDecryptorProxy {
// Initialize a decryptor, returns true if the object was
// constructed successfully.
- bool Setup(std::wstring& nss_path);
+ bool Setup(const std::wstring& nss_path);
// This match the parallel functions in NSSDecryptor.
bool DecryptorInit(const std::wstring& dll_path, const std::wstring& db_path);
@@ -67,7 +67,7 @@ FFUnitTestDecryptorProxy::FFUnitTestDecryptorProxy() {
FFUnitTestDecryptorProxy::~FFUnitTestDecryptorProxy() {
}
-bool FFUnitTestDecryptorProxy::Setup(std::wstring& /* nss_path */) {
+bool FFUnitTestDecryptorProxy::Setup(const std::wstring& /* nss_path */) {
return true;
}
diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
index bfea202..a6757f9 100644
--- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
+++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
@@ -123,7 +123,7 @@ FFUnitTestDecryptorProxy::FFUnitTestDecryptorProxy()
: child_process_(0) {
}
-bool FFUnitTestDecryptorProxy::Setup(std::wstring& nss_path) {
+bool FFUnitTestDecryptorProxy::Setup(const std::wstring& nss_path) {
// Create a new message loop and spawn the child process.
message_loop_.reset(new MessageLoopForIO());
diff --git a/chrome/browser/nacl_process_host.cc b/chrome/browser/nacl_process_host.cc
index 133f17f..9d7f445 100644
--- a/chrome/browser/nacl_process_host.cc
+++ b/chrome/browser/nacl_process_host.cc
@@ -116,8 +116,8 @@ bool NaClProcessHost::LaunchSelLdr(ResourceMessageFilter* renderer_msg_filter,
// Build command line for nacl.
const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
- std::wstring exe_path =
- browser_command_line.GetSwitchValue(switches::kBrowserSubprocessPath);
+ FilePath exe_path =
+ browser_command_line.GetSwitchValuePath(switches::kBrowserSubprocessPath);
if (exe_path.empty() && !PathService::Get(base::FILE_EXE, &exe_path))
return false;
@@ -125,8 +125,8 @@ bool NaClProcessHost::LaunchSelLdr(ResourceMessageFilter* renderer_msg_filter,
if (logging::DialogsAreSuppressed())
cmd_line.AppendSwitch(switches::kNoErrorDialogs);
- // propagate the following switches to the plugin command line (along with
- // any associated values) if present in the browser command line
+ // Propagate the following switches to the plugin command line (along with
+ // any associated values) if present in the browser command line.
// TODO(gregoryd): check which flags of those below can be supported.
static const char* const switch_names[] = {
switches::kNoSandbox,
diff --git a/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc b/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
index a6c6753..0f26e1a 100644
--- a/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
+++ b/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
@@ -27,10 +27,10 @@ class GtkKeyBindingsHandlerTest : public testing::Test {
GtkKeyBindingsHandlerTest()
: window_(gtk_window_new(GTK_WINDOW_TOPLEVEL)),
handler_(NULL) {
- std::wstring gtkrc;
+ FilePath gtkrc;
PathService::Get(chrome::DIR_TEST_DATA, &gtkrc);
- file_util::AppendToPath(&gtkrc, L"gtk_key_bindings_test_gtkrc");
- gtk_rc_parse(WideToUTF8(gtkrc).c_str());
+ gtkrc = gtkrc.AppendASCII("gtk_key_bindings_test_gtkrc");
+ gtk_rc_parse(gtkrc.value().c_str());
GtkWidget* fixed = gtk_fixed_new();
handler_ = new GtkKeyBindingsHandler(fixed);
diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc
index c89abe6..37aa55c 100644
--- a/chrome/browser/user_data_manager.cc
+++ b/chrome/browser/user_data_manager.cc
@@ -29,6 +29,15 @@
namespace {
+// TODO: don't use wstrings in all this code. :(
+// But I'm not fixing it right now since this code is reported to be going
+// away.
+void DeprecatedPathServiceGet(int key, std::wstring* str) {
+ FilePath path;
+ PathService::Get(key, &path);
+ *str = path.ToWStringHack();
+}
+
// Helper to start chrome for a given profile index. The helper takes care of
// enumerating profiles on the file thread and then it launches Chrome for the
// appropriate profile on the original thread.
@@ -95,7 +104,7 @@ UserDataManager* UserDataManager::instance_ = NULL;
UserDataManager* UserDataManager::Create() {
DCHECK(!instance_);
std::wstring user_data;
- PathService::Get(chrome::DIR_USER_DATA, &user_data);
+ DeprecatedPathServiceGet(chrome::DIR_USER_DATA, &user_data);
instance_ = new UserDataManager(user_data);
return instance_;
}
@@ -180,13 +189,13 @@ void UserDataManager::LaunchChromeForProfile(
const std::wstring& profile_name) const {
std::wstring user_data_dir = GetUserDataFolderForProfile(profile_name);
std::wstring command;
- PathService::Get(base::FILE_EXE, &command);
+ DeprecatedPathServiceGet(base::FILE_EXE, &command);
CommandLine command_line(command);
command_line.AppendSwitch(switches::kEnableUserDataDirProfiles);
command_line.AppendSwitchWithValue(switches::kUserDataDir,
user_data_dir);
std::wstring local_state_path;
- PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
+ DeprecatedPathServiceGet(chrome::FILE_LOCAL_STATE, &local_state_path);
command_line.AppendSwitchWithValue(switches::kParentProfile,
local_state_path);
base::LaunchApp(command_line, false, false, NULL);
diff --git a/chrome/browser/zygote_host_linux.cc b/chrome/browser/zygote_host_linux.cc
index bd3d099..34159264 100644
--- a/chrome/browser/zygote_host_linux.cc
+++ b/chrome/browser/zygote_host_linux.cc
@@ -46,7 +46,7 @@ static void SaveSUIDUnsafeEnvironmentVariables() {
}
ZygoteHost::ZygoteHost() {
- std::wstring chrome_path;
+ FilePath chrome_path;
CHECK(PathService::Get(base::FILE_EXE, &chrome_path));
CommandLine cmd_line(chrome_path);
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index cc53886..4f18195 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -644,10 +644,9 @@ DictionaryValue* UITest::GetLocalState() {
}
DictionaryValue* UITest::GetDefaultProfilePreferences() {
- std::wstring path_wstring;
- PathService::Get(chrome::DIR_USER_DATA, &path_wstring);
- file_util::AppendToPath(&path_wstring, chrome::kNotSignedInProfile);
- FilePath path(FilePath::FromWStringHack(path_wstring));
+ FilePath path;
+ PathService::Get(chrome::DIR_USER_DATA, &path);
+ path = path.AppendASCII(WideToASCII(chrome::kNotSignedInProfile));
return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename));
}