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

Unified Diff: chrome/browser/chromeos/file_system_provider/mount_path_util.cc

Issue 210803003: [fsp] Decouple file_service_provider::Service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 8 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: chrome/browser/chromeos/file_system_provider/mount_path_util.cc
diff --git a/chrome/browser/chromeos/file_system_provider/mount_path_util.cc b/chrome/browser/chromeos/file_system_provider/mount_path_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c535bdb4fa286b1ed9111eb84ccedaa84c9c5655
--- /dev/null
+++ b/chrome/browser/chromeos/file_system_provider/mount_path_util.cc
@@ -0,0 +1,40 @@
+// 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 "chrome/browser/chromeos/file_system_provider/mount_path_util.h"
+
+#include "base/files/file_path.h"
+#include "base/stl_util.h"
+#include "base/strings/string_number_conversions.h"
+#include "chrome/browser/chromeos/login/user.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
+
+namespace chromeos {
+namespace file_system_provider {
+namespace util {
+
+namespace {
+
+// Root mount path for all of the provided file systems.
+const base::FilePath::CharType kProvidedMountPointRoot[] =
+ FILE_PATH_LITERAL("/provided");
+
+} // namespace
+
+base::FilePath GetMountPointPath(Profile* profile,
+ std::string extension_id,
+ int file_system_id) {
+ chromeos::User* const user =
+ chromeos::UserManager::IsInitialized()
+ ? chromeos::UserManager::Get()->GetUserByProfile(
+ profile->GetOriginalProfile())
+ : NULL;
+ const std::string user_suffix = user ? "-" + user->username_hash() : "";
+ return base::FilePath(kProvidedMountPointRoot).AppendASCII(
+ extension_id + "-" + base::IntToString(file_system_id) + user_suffix);
+}
+
+} // namespace util
+} // namespace file_system_provider
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698