Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Set initial default download path
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Nov 16, 2017
1 parent b2ed30f commit 96c98a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions atom/browser/api/atom_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "brave/common/workers/v8_worker_thread.h"
#include "brave/common/workers/worker_bindings.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_paths_internal.h"
#include "components/component_updater/component_updater_paths.h"
#include "content/browser/plugin_service_impl.h"
#include "content/child/worker_thread_registry.h"
Expand Down Expand Up @@ -699,6 +700,12 @@ void App::SetPath(mate::Arguments* args,
args->ThrowError("Failed to set path");
}

base::FilePath App::GetInitialDownloadPath() {
base::FilePath path;
chrome::GetUserDownloadsDirectory(&path);
return path;
}

void App::SetDesktopName(const std::string& desktop_name) {
#if defined(OS_LINUX)
std::unique_ptr<base::Environment> env(base::Environment::Create());
Expand Down Expand Up @@ -948,6 +955,7 @@ void App::BuildPrototype(
#endif
.SetMethod("setPath", &App::SetPath)
.SetMethod("getPath", &App::GetPath)
.SetMethod("getInitialDownloadPath", &App::GetInitialDownloadPath)
.SetMethod("setDesktopName", &App::SetDesktopName)
.SetMethod("getLocale", &App::GetLocale)
.SetMethod("setLocale", &App::SetLocale)
Expand Down
2 changes: 2 additions & 0 deletions atom/browser/api/atom_api_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class App : public AtomBrowserClient::Delegate,
const std::string& name,
const base::FilePath& path);

base::FilePath GetInitialDownloadPath();

void SetDesktopName(const std::string& desktop_name);
void SetLocale(std::string);
std::string GetLocale();
Expand Down

0 comments on commit 96c98a6

Please # to comment.