diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index c864598a3191..19efd2d32ac8 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -10,6 +10,7 @@ #include "atom/browser/api/atom_api_cookies.h" #include "atom/browser/atom_browser_context.h" #include "atom/common/native_mate_converters/gurl_converter.h" +#include "atom/common/native_mate_converters/file_path_converter.h" #include "base/files/file_path.h" #include "base/prefs/pref_service.h" #include "base/strings/string_util.h" @@ -254,9 +255,9 @@ void Session::SetProxy(const std::string& proxy, base::Bind(&SetProxyInIO, base::Unretained(getter), proxy, callback)); } -void Session::SetDownloadPath(const std::string& path) { - browser_context_->prefs()->SetFilePath(prefs::kDownloadDefaultDirectory, - base::FilePath(path)); +void Session::SetDownloadPath(const base::FilePath& path) { + browser_context_->prefs()->SetFilePath( + prefs::kDownloadDefaultDirectory, path); } v8::Local Session::Cookies(v8::Isolate* isolate) { diff --git a/atom/browser/api/atom_api_session.h b/atom/browser/api/atom_api_session.h index a8c0e2444955..bd12b7589914 100644 --- a/atom/browser/api/atom_api_session.h +++ b/atom/browser/api/atom_api_session.h @@ -17,6 +17,10 @@ namespace mate { class Arguments; } +namespace base { +class FilePath; +} + namespace atom { class AtomBrowserContext; @@ -46,7 +50,7 @@ class Session: public mate::TrackableObject { void ClearCache(const net::CompletionCallback& callback); void ClearStorageData(mate::Arguments* args); void SetProxy(const std::string& proxy, const base::Closure& callback); - void SetDownloadPath(const std::string& path); + void SetDownloadPath(const base::FilePath& path); v8::Local Cookies(v8::Isolate* isolate); v8::Global cookies_;