Index: chromecast/common/cast_paths.cc |
diff --git a/chromecast/common/cast_paths.cc b/chromecast/common/cast_paths.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9bf047749d75bf4890f8fe2fce4edf6ed1d750c5 |
--- /dev/null |
+++ b/chromecast/common/cast_paths.cc |
@@ -0,0 +1,36 @@ |
+// Copyright 2014 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. |
+ |
+#include "chromecast/common/cast_paths.h" |
+ |
+#include "base/file_util.h" |
+#include "base/files/file_path.h" |
+#include "base/path_service.h" |
+ |
+namespace chromecast { |
+ |
+bool PathProvider(int key, base::FilePath* result) { |
+ switch (key) { |
+ case DIR_CAST_HOME: { |
+ base::FilePath home = base::GetHomeDir(); |
+#if defined(__arm__) |
Ryan Sleevi
2014/07/01 21:13:55
Seems strange to use this directly, when we have b
lcwu1
2014/07/02 23:30:33
Changed to use ARCH_CPU_ARMEL defined in build/bui
|
+ // When running on the actual device, our data directory is |
+ // $HOME for the chrome user. |
Ryan Sleevi
2014/07/01 21:13:55
This comment suggests a layering violation (commen
lcwu1
2014/07/02 23:30:32
This comment is really confusing, isn't it? What w
|
+ *result = home; |
+#else |
+ // When running a development instance as a regular user, use |
+ // a data directory under $HOME (similar to chrome). |
+ *result = home.Append(".config/cast_shell"); |
+#endif |
+ return true; |
+ } |
+ } |
+ return false; |
+} |
+ |
+void RegisterPathProvider() { |
+ PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
+} |
+ |
+} // namespace chromecast |