forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchrome_paths_fuchsia.cc
71 lines (55 loc) · 1.87 KB
/
chrome_paths_fuchsia.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(crbug.com/1231928): Define user data directory paths within the
// Chrome component namespace, or update UX to remove these concepts where they
// will not apply under Fuchsia.
#include "chrome/common/chrome_paths.h"
#include "base/files/file_path.h"
#include "base/fuchsia/file_utils.h"
#include "base/notreached.h"
namespace chrome {
namespace {
constexpr char kDocumentsDir[] = "Documents";
constexpr char kDownloadsDir[] = "Downloads";
} // namespace
bool GetDefaultUserDataDirectory(base::FilePath* result) {
*result = base::FilePath(base::kPersistedDataDirectoryPath);
return true;
}
void GetUserCacheDirectory(const base::FilePath& profile_dir,
base::FilePath* result) {
*result = base::FilePath(base::kPersistedCacheDirectoryPath);
}
bool GetUserDocumentsDirectory(base::FilePath* result) {
if (!GetDefaultUserDataDirectory(result))
return false;
*result = result->Append(kDocumentsDir);
return true;
}
bool GetUserDownloadsDirectorySafe(base::FilePath* result) {
if (!GetDefaultUserDataDirectory(result))
return false;
*result = result->Append(kDownloadsDir);
return true;
}
bool GetUserDownloadsDirectory(base::FilePath* result) {
return GetUserDownloadsDirectorySafe(result);
}
bool GetUserMusicDirectory(base::FilePath* result) {
NOTIMPLEMENTED_LOG_ONCE();
return false;
}
bool GetUserPicturesDirectory(base::FilePath* result) {
NOTIMPLEMENTED_LOG_ONCE();
return false;
}
bool GetUserVideosDirectory(base::FilePath* result) {
NOTIMPLEMENTED_LOG_ONCE();
return false;
}
bool ProcessNeedsProfileDir(const std::string& process_type) {
// Only the browser actually needs DIR_USER_DATA to be set.
return process_type.empty();
}
} // namespace chrome