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

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: Remove ScreenCast code and stale comments. Created 6 years, 6 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..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

Powered by Google App Engine
This is Rietveld 408576698