]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix compilation error caused by #2340
authorCheng Zhao <zcbenz@gmail.com>
Thu, 30 Jul 2015 02:38:04 +0000 (10:38 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 30 Jul 2015 02:38:04 +0000 (10:38 +0800)
atom/browser/api/atom_api_session.cc
atom/browser/api/atom_api_session.h

index c864598a3191bd37bbda17aceabd5971a0ff16fb..19efd2d32ac8f4a8b48556f42127a8004163f109 100644 (file)
@@ -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<v8::Value> Session::Cookies(v8::Isolate* isolate) {
index a8c0e2444955b8a69f9de27ed6be4e3830f25823..bd12b7589914cb07142432b24d6c6fdb04b35d97 100644 (file)
@@ -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<Session> {
   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<v8::Value> Cookies(v8::Isolate* isolate);
 
   v8::Global<v8::Value> cookies_;