Fix some interleaving issues in EmbeddedWorkerInstance.
[chromium-blink-merge.git] / chrome / common / chrome_paths_android.cc
bloba78b48d584c24b7491f94ae460537283e81f2c2a
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/common/chrome_paths_internal.h"
7 #include "base/files/file_path.h"
8 #include "base/logging.h"
9 #include "base/path_service.h"
10 #include "content/public/common/content_switches.h"
12 namespace chrome {
14 void GetUserCacheDirectory(const base::FilePath& profile_dir,
15 base::FilePath* result) {
16 if (!PathService::Get(base::DIR_CACHE, result))
17 *result = profile_dir;
20 bool GetDefaultUserDataDirectory(base::FilePath* result) {
21 return PathService::Get(base::DIR_ANDROID_APP_DATA, result);
24 bool GetUserDocumentsDirectory(base::FilePath* result) {
25 if (!GetDefaultUserDataDirectory(result))
26 return false;
27 *result = result->Append("Documents");
28 return true;
31 bool GetUserDownloadsDirectory(base::FilePath* result) {
32 if (!GetDefaultUserDataDirectory(result))
33 return false;
34 *result = result->Append("Downloads");
35 return true;
38 bool GetUserMusicDirectory(base::FilePath* result) {
39 NOTIMPLEMENTED();
40 return false;
43 bool GetUserPicturesDirectory(base::FilePath* result) {
44 NOTIMPLEMENTED();
45 return false;
48 bool GetUserVideosDirectory(base::FilePath* result) {
49 NOTIMPLEMENTED();
50 return false;
53 bool ProcessNeedsProfileDir(const std::string& process_type) {
54 // SELinux prohibits accessing the data directory from isolated services. Only
55 // the browser (empty process type) should access the profile directory.
56 return process_type.empty();
59 } // namespace chrome