summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-30 20:46:33 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-30 20:46:33 +0000
commit1f733cf713cdb0a05f24657a278d49c3a4b88a30 (patch)
tree2a966ac70350e26df001b64dfd4811ccce41ceed /chrome
parent57a336aa8b9a591e42fadcae359b20d596af7526 (diff)
downloadchromium_src-1f733cf713cdb0a05f24657a278d49c3a4b88a30.zip
chromium_src-1f733cf713cdb0a05f24657a278d49c3a4b88a30.tar.gz
chromium_src-1f733cf713cdb0a05f24657a278d49c3a4b88a30.tar.bz2
Landing patch from contributor Thiago Farina.
Update GetDownloadDirectory to take FilePath instead of wstring to avoid conversions "To and From wstring". BUG=None TEST=run ui_tests.exe Review URL: http://codereview.chromium.org/243047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/automation/automation_provider.cc4
-rw-r--r--chrome/browser/automation/automation_provider.h3
-rw-r--r--chrome/browser/download/download_uitest.cc2
-rw-r--r--chrome/browser/download/save_page_uitest.cc2
-rw-r--r--chrome/test/automation/automation_messages_internal.h2
-rw-r--r--chrome/test/automation/tab_proxy.cc2
-rw-r--r--chrome/test/automation/tab_proxy.h2
-rw-r--r--chrome/test/ui/ui_test.cc6
-rw-r--r--chrome/test/ui/ui_test.h2
9 files changed, 12 insertions, 13 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index f93d39c..0f77ad3 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -1246,13 +1246,13 @@ void AutomationProvider::SetProxyConfig(const std::string& new_proxy_config) {
}
void AutomationProvider::GetDownloadDirectory(
- int handle, std::wstring* download_directory) {
+ int handle, FilePath* download_directory) {
DLOG(INFO) << "Handling download directory request";
if (tab_tracker_->ContainsHandle(handle)) {
NavigationController* tab = tab_tracker_->GetResource(handle);
DownloadManager* dlm = tab->profile()->GetDownloadManager();
DCHECK(dlm);
- *download_directory = dlm->download_path().ToWStringHack();
+ *download_directory = dlm->download_path();
}
}
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index be11f91..6b72395 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -271,8 +271,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
int y,
IPC::Message* reply_message);
- void GetDownloadDirectory(int handle,
- std::wstring* download_directory);
+ void GetDownloadDirectory(int handle, FilePath* download_directory);
// Retrieves a Browser from a Window and vice-versa.
void GetWindowForBrowser(int window_handle, bool* success, int* handle);
diff --git a/chrome/browser/download/download_uitest.cc b/chrome/browser/download/download_uitest.cc
index 3c134fd..7bd547d 100644
--- a/chrome/browser/download/download_uitest.cc
+++ b/chrome/browser/download/download_uitest.cc
@@ -88,7 +88,7 @@ class DownloadTest : public UITest {
virtual void SetUp() {
UITest::SetUp();
- download_prefix_ = FilePath::FromWStringHack(GetDownloadDirectory());
+ download_prefix_ = GetDownloadDirectory();
}
protected:
diff --git a/chrome/browser/download/save_page_uitest.cc b/chrome/browser/download/save_page_uitest.cc
index cf21ca3..1149397 100644
--- a/chrome/browser/download/save_page_uitest.cc
+++ b/chrome/browser/download/save_page_uitest.cc
@@ -46,7 +46,7 @@ class SavePageTest : public UITest {
EXPECT_TRUE(file_util::CreateNewTempDirectory(FILE_PATH_LITERAL(""),
&save_dir_));
- download_dir_ = FilePath::FromWStringHack(GetDownloadDirectory());
+ download_dir_ = GetDownloadDirectory();
}
virtual void TearDown() {
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index 89f90ff..5836ec6 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -338,7 +338,7 @@ IPC_BEGIN_MESSAGES(Automation)
// Gets the directory that downloads will occur in for the active profile.
IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_DownloadDirectory,
int /* tab_handle */,
- std::wstring /* directory */)
+ FilePath /* directory */)
// This message requests the id of the view that has the focus in the
// specified window. If no view is focused, -1 is returned. Note that the
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index eb00d74..76965e5 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -451,7 +451,7 @@ int TabProxy::InspectElement(int x, int y) {
return ret;
}
-bool TabProxy::GetDownloadDirectory(std::wstring* directory) {
+bool TabProxy::GetDownloadDirectory(FilePath* directory) {
DCHECK(directory);
if (!is_valid())
return false;
diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h
index 94bf717..7209ada 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -223,7 +223,7 @@ class TabProxy : public AutomationResourceProxy {
// |target_count|.
bool WaitForBlockedPopupCountToChangeTo(int target_count, int wait_timeout);
- bool GetDownloadDirectory(std::wstring* download_directory);
+ bool GetDownloadDirectory(FilePath* download_directory);
// Shows an interstitial page. Blocks until the interstitial page
// has been loaded. Return false if a failure happens.3
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index cfabbc2..65a453d 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -733,13 +733,13 @@ void UITest::WaitUntilTabCount(int tab_count) {
EXPECT_EQ(tab_count, GetTabCount());
}
-std::wstring UITest::GetDownloadDirectory() {
+FilePath UITest::GetDownloadDirectory() {
scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
EXPECT_TRUE(tab_proxy.get());
if (!tab_proxy.get())
- return std::wstring();
+ return FilePath();
- std::wstring download_directory;
+ FilePath download_directory;
EXPECT_TRUE(tab_proxy->GetDownloadDirectory(&download_directory));
return download_directory;
}
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index ae62a6e..5c45e8c 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -269,7 +269,7 @@ class UITest : public testing::Test {
bool important);
// Gets the directory for the currently active profile in the browser.
- std::wstring GetDownloadDirectory();
+ FilePath GetDownloadDirectory();
// Get the handle of browser process connected to the automation. This
// function only retruns a reference to the handle so the caller does not