scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 1 | // Copyright 2017 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. |
| 4 | |
| 5 | #include "base/base_paths.h" |
| 6 | |
| 7 | #include "base/files/file_path.h" |
| 8 | |
| 9 | namespace base { |
| 10 | |
| 11 | bool PathProviderFuchsia(int key, FilePath* result) { |
Scott Graham | 4bd2b07f | 2017-06-01 04:17:04 | [diff] [blame^] | 12 | // TODO(fuchsia): There's no API to retrieve these on Fuchsia. The app name |
| 13 | // itself should be dynamic (i.e. not always "chrome") but other paths are |
| 14 | // correct as fixed paths like this. See https://crbug.com/726124. |
scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 15 | switch (key) { |
| 16 | case FILE_EXE: |
Scott Graham | 4bd2b07f | 2017-06-01 04:17:04 | [diff] [blame^] | 17 | *result = FilePath("/pkg/bin/chrome"); |
scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 18 | return true; |
Scott Graham | 4bd2b07f | 2017-06-01 04:17:04 | [diff] [blame^] | 19 | case FILE_MODULE: |
| 20 | *result = FilePath("/pkg/lib/chrome"); |
| 21 | return true; |
| 22 | case DIR_SOURCE_ROOT: |
| 23 | // This is only used for tests, so we return the binary location for now. |
| 24 | *result = FilePath("/system"); |
| 25 | return true; |
| 26 | case DIR_CACHE: |
| 27 | *result = FilePath("/data"); |
| 28 | return true; |
scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | return false; |
| 32 | } |
| 33 | |
| 34 | } // namespace base |