mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Implement BrowserClient::GetDefaultDownloadDirectory().
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
#include "browser/media/media_capture_devices_dispatcher.h"
|
||||
#include "browser/notification_presenter.h"
|
||||
|
||||
#include "base/base_paths.h"
|
||||
#include "base/path_service.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
|
||||
namespace brightray {
|
||||
@@ -84,4 +86,13 @@ void BrowserClient::GetAdditionalAllowedSchemesForFileSystem(
|
||||
additional_schemes->push_back(content::kChromeUIScheme);
|
||||
}
|
||||
|
||||
base::FilePath BrowserClient::GetDefaultDownloadDirectory() {
|
||||
// ~/Downloads
|
||||
base::FilePath path;
|
||||
if (PathService::Get(base::DIR_HOME, &path))
|
||||
path = path.Append(FILE_PATH_LITERAL("Downloads"));
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
||||
@@ -49,6 +49,7 @@ class BrowserClient : public content::ContentBrowserClient {
|
||||
virtual content::MediaObserver* GetMediaObserver() OVERRIDE;
|
||||
virtual void GetAdditionalAllowedSchemesForFileSystem(
|
||||
std::vector<std::string>* additional_schemes) OVERRIDE;
|
||||
virtual base::FilePath GetDefaultDownloadDirectory() OVERRIDE;
|
||||
|
||||
BrowserMainParts* browser_main_parts_;
|
||||
scoped_ptr<NotificationPresenter> notification_presenter_;
|
||||
|
||||
Reference in New Issue
Block a user