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

Unified Diff: ios/chrome/browser/reading_list/offline_url_utils.h

Issue 2506993002: Create offline_url_utils (Closed)
Patch Set: feedback Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/reading_list/BUILD.gn ('k') | ios/chrome/browser/reading_list/offline_url_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d10345bc5b931c07ae4b24ad8c6bcf0deea01272
--- /dev/null
+++ b/ios/chrome/browser/reading_list/offline_url_utils.h
@@ -0,0 +1,57 @@
+// 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.
+// |profile_path| is the path to the profile directory that contain the offline
+// directory.
+base::FilePath OfflineRootDirectoryPath(const base::FilePath& profile_path);
+
+// The absolute path of the directory where a |url| is saved offline.
+// Contains the page and supporting files (images).
+// |profile_path| is the path to the profile directory that contain the offline
+// directory.
+// The directory may not exist.
+base::FilePath OfflineURLDirectoryAbsolutePath(
+ const base::FilePath& profile_path,
+ const GURL& url);
+
+// The absolute path of the offline webpage for the |url|. The file may not
+// exist.
+// |profile_path| is the path to the profile directory that contain the offline
+// directory.
+base::FilePath OfflinePageAbsolutePath(const base::FilePath& profile_path,
+ const GURL& url);
+
+// The relative path to the offline webpage for the |url|. The result is
+// relative to |OfflineRootDirectoryPath()|.
+// The file may not exist.
+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 to display |distilled_url|.
+// If |resources_root_url| is not nullptr, it is set to a file 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_
« no previous file with comments | « ios/chrome/browser/reading_list/BUILD.gn ('k') | ios/chrome/browser/reading_list/offline_url_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698