blob: 6f1ec38ee9da64d6327ae5b4ba450b30b4ad7bb0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright (c) 2012 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.
#ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_
#define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_
#pragma once
#include <string>
class FilePath;
class Profile;
namespace gdata {
namespace util {
// Returns the GData mount point path, which looks like "/special/gdata".
const FilePath& GetGDataMountPointPath();
// Returns the GData mount path as string.
const std::string& GetGDataMountPointPathAsString();
// Returns the 'local' root of remote file system as "/special".
const FilePath& GetSpecialRemoteRootPath();
// Returns true if the given path is under the GData mount point.
bool IsUnderGDataMountPoint(const FilePath& path);
// Extracts the GData path from the given path located under the GData mount
// point. Returns an empty path if |path| is not under the GData mount point.
// Examples: ExtractGDatPath("/special/gdata/foo.txt") => "gdata/foo.txt"
FilePath ExtractGDataPath(const FilePath& path);
// Grants read-only file access permissions to the process whose id is |pid|
// with ChildProcessSecurityPolicy for all possible cache paths that may be
// given to the specified file.
void SetPermissionsForGDataCacheFiles(Profile* profile,
int pid,
const FilePath& path);
} // namespace util
} // namespace gdata
#endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_
|