- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / file_manager / path_util.h
1 // Copyright 2013 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_PATH_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_PATH_UTIL_H_
7
8 class Profile;
9
10 namespace base {
11 class FilePath;
12 }
13
14 namespace file_manager {
15 namespace util {
16
17 // Gets the absolute path for the 'Downloads' folder for the |profile|.
18 base::FilePath GetDownloadsFolderForProfile(Profile* profile);
19
20 // Converts |old_path| to |new_path| and returns true, if the old path points
21 // to an old location of user folders (in "Downloads" or "Google Drive").
22 // The |profile| argument is used for determining the location of the
23 // "Downloads" folder.
24 //
25 // Here's the list of relocations we have made so far.
26 //
27 // M28: crbug.com/229304
28 //   The "Google Drive" folder is moved from /special/drive to
29 //   /special/drive/root to stored shared files outside of "My Drive" in
30 //   /special/drive/other.
31 //
32 // [TODO(kinaba) not yet happening at this point crbug/309556]
33 // M32: crbug.com/313539
34 //   The "Downloads" folder is changed from /home/chronos/user/Downloads to
35 //   /home/chronos/u-<hash>/Downloads to support multi profiles.
36 //
37 //   The path "/home/chronos/user" is a hard link to the u-<hash> directory of
38 //   the primary profile of the current session. The two paths always meant the
39 //   same directory before multi-profiles. However, for secondary profiles in
40 //   a multi-profile session, the "user" path cannot be used to mean "its own"
41 //   Download folder anymore. Thus we are switching to always use "u-<hash>"
42 //   that consistently works whether or not multi-profile is enabled.
43 bool MigratePathFromOldFormat(Profile* profile,
44                               const base::FilePath& old_path,
45                               base::FilePath* new_path);
46
47 }  // namespace util
48 }  // namespace file_manager
49
50 #endif  // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_PATH_UTIL_H_