#include "base/debug/stack_trace.h"
#include "base/environment.h"
#include "base/logging.h"
+#include "chrome/common/chrome_paths.h"
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
if (enable_stack_dumping)
base::debug::EnableInProcessStackDumping();
+ chrome::RegisterPathProvider();
+
return brightray::MainDelegate::BasicStartupComplete(exit_code);
}
#include "base/command_line.h"
#include "base/environment.h"
#include "base/files/file_path.h"
-#include "base/nix/xdg_util.h"
#include "base/path_service.h"
#include "brightray/browser/brightray_paths.h"
+#include "chrome/common/chrome_paths.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/common/content_switches.h"
return base::DIR_HOME;
else if (name == "temp")
return base::DIR_TEMP;
- else if (name == "userDesktop")
+ else if (name == "userDesktop" || name == "desktop")
return base::DIR_USER_DESKTOP;
else if (name == "exe")
return base::FILE_EXE;
else if (name == "module")
return base::FILE_MODULE;
+ else if (name == "documents")
+ return chrome::DIR_USER_DOCUMENTS;
+ else if (name == "downloads")
+ return chrome::DIR_DEFAULT_DOWNLOADS;
+ else if (name == "music")
+ return chrome::DIR_USER_MUSIC;
+ else if (name == "pictures")
+ return chrome::DIR_USER_PICTURES;
+ else if (name == "videos")
+ return chrome::DIR_USER_VIDEOS;
else
return -1;
}
login_handler->CancelAuth();
}
-bool GetUserDownloadsDirectory(base::FilePath* path) {
-#if defined(OS_LINUX)
- *path = base::nix::GetXDGUserDirectory("DOWNLOAD", "Downloads");
- return true;
-#elif defined(OS_MACOSX)
- return false;
-#elif defined(OS_WIN)
- return false;
-#endif
-}
-
} // namespace
App::App() {
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::Get(key, &path);
- if (!succeed) {
- if (name == "downloads" && GetUserDownloadsDirectory(&path))
- return path;
+ if (!succeed)
args->ThrowError("Failed to get path");
- }
return path;
}
* `userData` The directory for storing your app's configuration files, which by
default it is the `appData` directory appended with your app's name.
* `temp` Temporary directory.
-* `userDesktop` The current user's Desktop directory.
* `exe` The current executable file.
* `module` The `libchromiumcontent` library.
-* `downloads` User's download directory.
+* `desktop` The current user's Desktop directory.
+* `documents` Directory for a user's "My Documents".
+* `downloads` Directory for a user's downloads.
+* `music` Directory for a user's music.
+* `pictures` Directory for a user's pictures.
+* `videos` Directory for a user's videos.
### `app.setPath(name, path)`