Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: chromecast/common/cast_paths.cc

Issue 223143003: Initial checkin of chromecast content embedder (cast_shell) and related build scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Additional presubmit clean-up. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b3a77166d96bb6ce5acfa3f41fdecf87ad7f9ecf
--- /dev/null
+++ b/chromecast/common/cast_paths.cc
@@ -0,0 +1,37 @@
+// 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"
+#include "build/build_config.h"
+
+namespace chromecast {
+
+bool PathProvider(int key, base::FilePath* result) {
+ switch (key) {
+ case DIR_CAST_HOME: {
+ base::FilePath home = base::GetHomeDir();
+#if defined(ARCH_CPU_ARMEL)
+ // When running on the actual device, $HOME is set to the user's
+ // directory under the data partition.
+ *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

Powered by Google App Engine
This is Rietveld 408576698