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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h"
6
7 #include "base/files/file_path.h"
8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h"
10 #include "chrome/browser/chromeos/login/user.h"
11 #include "chrome/browser/chromeos/login/user_manager.h"
12
13 namespace chromeos {
14 namespace file_system_provider {
15 namespace util {
16
17 namespace {
18
19 // Root mount path for all of the provided file systems.
20 const base::FilePath::CharType kProvidedMountPointRoot[] =
21 FILE_PATH_LITERAL("/provided");
22
23 } // namespace
24
25 base::FilePath GetMountPointPath(Profile* profile,
26 std::string extension_id,
27 int file_system_id) {
28 chromeos::User* const user =
29 chromeos::UserManager::IsInitialized()
30 ? chromeos::UserManager::Get()->GetUserByProfile(
31 profile->GetOriginalProfile())
32 : NULL;
33 const std::string user_suffix = user ? "-" + user->username_hash() : "";
34 return base::FilePath(kProvidedMountPointRoot).AppendASCII(
35 extension_id + "-" + base::IntToString(file_system_id) + user_suffix);
36 }
37
38 } // namespace util
39 } // namespace file_system_provider
40 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698