OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ | 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |
6 #define IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ | 6 #define IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 namespace reading_list { | 13 namespace reading_list { |
14 | 14 |
15 // The absolute path of the directory where offline URLs are saved. | |
16 // |profile_path| is the path to the profile directory that contain the offline | |
17 // directory. | |
18 base::FilePath OfflineRootDirectoryPath(const base::FilePath& profile_path); | |
19 | |
20 // The absolute path of the directory where a |url| is saved offline. | |
21 // Contains the page and supporting files (images). | |
22 // |profile_path| is the path to the profile directory that contain the offline | |
23 // directory. | |
24 // The directory may not exist. | |
25 base::FilePath OfflineURLDirectoryAbsolutePath( | |
26 const base::FilePath& profile_path, | |
27 const GURL& url); | |
28 | |
29 // The absolute path of the offline webpage for the |url|. The file may not | |
30 // exist. | |
31 // |profile_path| is the path to the profile directory that contain the offline | |
32 // directory. | |
33 base::FilePath OfflinePageAbsolutePath(const base::FilePath& profile_path, | |
34 const GURL& url); | |
35 | |
36 // The relative path to the offline webpage for the |url|. The result is | |
37 // relative to |OfflineRootDirectoryPath()|. | |
38 // The file may not exist. | |
39 base::FilePath OfflinePagePath(const GURL& url); | |
40 | |
41 // The name of the directory containing offline data for |url|. | |
42 std::string OfflineURLDirectoryID(const GURL& url); | |
43 | |
44 // The distilled URL chrome://offline/... that will load the file at |path|. | 15 // The distilled URL chrome://offline/... that will load the file at |path|. |
45 GURL DistilledURLForPath(const base::FilePath& path); | 16 GURL DistilledURLForPath(const base::FilePath& path); |
46 | 17 |
47 // The file URL pointing to the local file to load to display |distilled_url|. | 18 // The file URL pointing to the local file to load to display |distilled_url|. |
48 // If |resources_root_url| is not nullptr, it is set to a file URL to the | 19 // If |resources_root_url| is not nullptr, it is set to a file URL to the |
49 // directory conatining all the resources needed by |distilled_url|. | 20 // directory conatining all the resources needed by |distilled_url|. |
50 // |profile_path| is the path to the profile directory. | 21 // |profile_path| is the path to the profile directory. |
51 GURL FileURLForDistilledURL(const GURL& distilled_url, | 22 GURL FileURLForDistilledURL(const GURL& distilled_url, |
52 const base::FilePath& profile_path, | 23 const base::FilePath& profile_path, |
53 GURL* resources_root_url); | 24 GURL* resources_root_url); |
54 | 25 |
55 } // namespace reading_list | 26 } // namespace reading_list |
56 | 27 |
57 #endif // IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ | 28 #endif // IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |
OLD | NEW |