1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/base_paths.h"
9 #include "base/command_line.h"
10 #include "base/files/file_util.h"
11 #include "base/fuchsia/file_utils.h"
12 #include "base/notreached.h"
13 #include "base/path_service.h"
14 #include "base/process/process.h"
18 bool PathProviderFuchsia(int key, FilePath* result) {
21 *result = CommandLine::ForCurrentProcess()->GetProgram();
24 *result = base::FilePath(base::kPackageRootDirectoryPath);
26 case DIR_SRC_TEST_DATA_ROOT:
27 case DIR_GEN_TEST_DATA_ROOT:
28 // These are only used by tests.
29 // Test binaries are added to the package root via GN deps.
30 *result = base::FilePath(base::kPackageRootDirectoryPath);
32 case DIR_USER_DESKTOP:
33 // TODO(crbug.com/1231928): Implement this case for DIR_USER_DESKTOP.
34 NOTIMPLEMENTED_LOG_ONCE();
37 // TODO(crbug.com/1231928) Provide a proper base::GetHomeDir()
38 // implementation for Fuchsia and remove this case statement. See also
39 // crbug.com/1261284. For now, log, return false, and let the base
40 // implementation handle it. This will end up returning a temporary
42 // This is for DIR_HOME. Will use temporary dir.
43 NOTIMPLEMENTED_LOG_ONCE();