OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/common/cast_paths.h" | 5 #include "chromecast/common/cast_paths.h" |
6 | 6 |
| 7 #include "base/base_paths.h" |
7 #include "base/file_util.h" | 8 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 10 #include "base/path_service.h" |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 | 12 |
12 namespace chromecast { | 13 namespace chromecast { |
13 | 14 |
14 bool PathProvider(int key, base::FilePath* result) { | 15 bool PathProvider(int key, base::FilePath* result) { |
15 switch (key) { | 16 switch (key) { |
16 case DIR_CAST_HOME: { | 17 case DIR_CAST_HOME: { |
(...skipping 13 matching lines...) Expand all Loading... |
30 base::FilePath data_dir; | 31 base::FilePath data_dir; |
31 #if defined(OS_ANDROID) | 32 #if defined(OS_ANDROID) |
32 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &data_dir); | 33 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &data_dir); |
33 *result = data_dir.Append("cast_shell.conf"); | 34 *result = data_dir.Append("cast_shell.conf"); |
34 #else | 35 #else |
35 CHECK(PathService::Get(DIR_CAST_HOME, &data_dir)); | 36 CHECK(PathService::Get(DIR_CAST_HOME, &data_dir)); |
36 *result = data_dir.Append(".eureka.conf"); | 37 *result = data_dir.Append(".eureka.conf"); |
37 #endif // defined(OS_ANDROID) | 38 #endif // defined(OS_ANDROID) |
38 return true; | 39 return true; |
39 } | 40 } |
| 41 case FILE_CAST_PAK: { |
| 42 base::FilePath base_dir; |
| 43 #if defined(OS_ANDROID) |
| 44 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &base_dir)); |
| 45 *result = base_dir.Append("paks/cast_shell.pak"); |
| 46 #else |
| 47 CHECK(PathService::Get(base::DIR_MODULE, &base_dir)); |
| 48 *result = base_dir.Append("assets/cast_shell.pak"); |
| 49 #endif // defined(OS_ANDROID) |
| 50 return true; |
| 51 } |
40 } | 52 } |
41 return false; | 53 return false; |
42 } | 54 } |
43 | 55 |
44 void RegisterPathProvider() { | 56 void RegisterPathProvider() { |
45 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 57 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
46 } | 58 } |
47 | 59 |
48 } // namespace chromecast | 60 } // namespace chromecast |
OLD | NEW |