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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/mount_path_util.cc

Issue 898003002: [Cleanup] Const-correct the profile() method for the EasyUnlockService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h" 5 #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } else { 43 } else {
44 escaped.push_back(c); 44 escaped.push_back(c);
45 } 45 }
46 } 46 }
47 return escaped; 47 return escaped;
48 } 48 }
49 49
50 base::FilePath GetMountPath(Profile* profile, 50 base::FilePath GetMountPath(Profile* profile,
51 const std::string& extension_id, 51 const std::string& extension_id,
52 const std::string& file_system_id) { 52 const std::string& file_system_id) {
53 user_manager::User* const user = 53 const user_manager::User* const user =
54 user_manager::UserManager::IsInitialized() 54 user_manager::UserManager::IsInitialized()
55 ? chromeos::ProfileHelper::Get()->GetUserByProfile( 55 ? chromeos::ProfileHelper::Get()->GetUserByProfile(
56 profile->GetOriginalProfile()) 56 profile->GetOriginalProfile())
57 : NULL; 57 : NULL;
58 const std::string safe_file_system_id = EscapeFileSystemId(file_system_id); 58 const std::string safe_file_system_id = EscapeFileSystemId(file_system_id);
59 const std::string username_suffix = user ? user->username_hash() : ""; 59 const std::string username_suffix = user ? user->username_hash() : "";
60 return base::FilePath(kProvidedMountPointRoot).AppendASCII( 60 return base::FilePath(kProvidedMountPointRoot).AppendASCII(
61 extension_id + ":" + safe_file_system_id + ":" + username_suffix); 61 extension_id + ":" + safe_file_system_id + ":" + username_suffix);
62 } 62 }
63 63
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 for (size_t i = 3; i < components.size(); ++i) { 170 for (size_t i = 3; i < components.size(); ++i) {
171 file_path_ = file_path_.Append(components[i]); 171 file_path_ = file_path_.Append(components[i]);
172 } 172 }
173 173
174 return true; 174 return true;
175 } 175 }
176 176
177 } // namespace util 177 } // namespace util
178 } // namespace file_system_provider 178 } // namespace file_system_provider
179 } // namespace chromeos 179 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698