OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "ui/base/ui_base_paths.h" | 5 #include "ui/base/ui_base_paths.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &cur)) | 56 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &cur)) |
57 return false; | 57 return false; |
58 cur = cur.Append(FILE_PATH_LITERAL("paks")); | 58 cur = cur.Append(FILE_PATH_LITERAL("paks")); |
59 break; | 59 break; |
60 #endif | 60 #endif |
61 default: | 61 default: |
62 return false; | 62 return false; |
63 } | 63 } |
64 | 64 |
65 if (create_dir && !base::PathExists(cur) && | 65 if (create_dir && !base::PathExists(cur) && |
66 !file_util::CreateDirectory(cur)) | 66 !base::CreateDirectory(cur)) |
67 return false; | 67 return false; |
68 | 68 |
69 *result = cur; | 69 *result = cur; |
70 return true; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 // This cannot be done as a static initializer sadly since Visual Studio will | 73 // This cannot be done as a static initializer sadly since Visual Studio will |
74 // eliminate this object file if there is no direct entry point into it. | 74 // eliminate this object file if there is no direct entry point into it. |
75 void RegisterPathProvider() { | 75 void RegisterPathProvider() { |
76 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 76 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
77 } | 77 } |
78 | 78 |
79 } // namespace ui | 79 } // namespace ui |
OLD | NEW |