Chromium Code Reviews| Index: ios/chrome/browser/reading_list/offline_url_utils.h |
| diff --git a/ios/chrome/browser/reading_list/offline_url_utils.h b/ios/chrome/browser/reading_list/offline_url_utils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..44e483b131f34ca1b7d20e277c7f020b0fdf54ec |
| --- /dev/null |
| +++ b/ios/chrome/browser/reading_list/offline_url_utils.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2016 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 IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |
| +#define IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/files/file_path.h" |
| +#include "url/gurl.h" |
| + |
| +namespace reading_list { |
| + |
| +// The absolute path of the directory where offline URLs are saved. |
| +base::FilePath OfflineRootDirectoryPath(const base::FilePath& profile_path); |
|
gambard
2016/11/16 12:44:20
Add comments for the argument please.
Olivier
2016/11/16 13:36:27
Done.
|
| + |
| +// The absolute path of the directory where a specific URL is saved offline. |
| +// Contains the page and supporting files (images). |
| +base::FilePath OfflineURLDirectoryAbsolutePath( |
| + const base::FilePath& profile_path, |
|
gambard
2016/11/16 12:44:19
Same
Olivier
2016/11/16 13:36:27
Done.
|
| + const GURL& url); |
| + |
| +// The absolute path of the offline webpage for the URL. The file may not |
| +// exist. |
| +base::FilePath OfflinePageAbsolutePath(const base::FilePath& profile_path, |
|
gambard
2016/11/16 12:44:20
Same
Olivier
2016/11/16 13:36:27
Done.
|
| + const GURL& url); |
| + |
| +// The relative path to the distilled page. The result is relative to |
|
gambard
2016/11/16 12:44:19
Please add a logical link between "distilled page"
Olivier
2016/11/16 13:36:27
Done.
|
| +// |OfflineRootDirectoryPath()|. |
| +base::FilePath OfflinePagePath(const GURL& url); |
| + |
| +// The name of the directory containing offline data for |url|. |
| +std::string OfflineURLDirectoryID(const GURL& url); |
| + |
| +// The distilled URL chrome://offline/... that will load the file at |path|. |
| +GURL DistilledURLForPath(const base::FilePath& path); |
| + |
| +// The file URL pointing to the local file to load whan displaying |
|
gambard
2016/11/16 12:44:20
s/whan/when/
Olivier
2016/11/16 13:36:27
Done.
|
| +// |distilled_url|. If |resources_root_url| is not nullptr, it is set to a file |
|
gambard
2016/11/16 12:44:19
Maybe add where we are displaying |distilled_url|?
Olivier
2016/11/16 13:36:27
I don't think this utility function needs to know
|
| +// URL to the directory conatining all the resources needed by |distilled_url|. |
| +// |profile_path| is the path to the profile directory. |
| +GURL FileURLForDistilledURL(const GURL& distilled_url, |
| + const base::FilePath& profile_path, |
| + GURL* resources_root_url); |
| + |
| +} // namespace reading_list |
| + |
| +#endif // IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |