Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / common / chrome_paths_android.cc
blobedbac864540f8d8f7f730e6ad992a91e9210a0e3
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 for isolated services.
55 if (process_type == switches::kRendererProcess)
56 return false;
58 return true;
61 } // namespace chrome