diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index be69a349a7fd..3c7377d6d9a0 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -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 diff --git a/brightray/browser/browser_client.h b/brightray/browser/browser_client.h index b6ff42acd410..6d1944ca0264 100644 --- a/brightray/browser/browser_client.h +++ b/brightray/browser/browser_client.h @@ -49,6 +49,7 @@ class BrowserClient : public content::ContentBrowserClient { virtual content::MediaObserver* GetMediaObserver() OVERRIDE; virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_schemes) OVERRIDE; + virtual base::FilePath GetDefaultDownloadDirectory() OVERRIDE; BrowserMainParts* browser_main_parts_; scoped_ptr notification_presenter_;