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

Unified Diff: components/reading_list/offline_url_utils.cc

Issue 2514333003: Componentize Reading List (Closed)
Patch Set: fix 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
Index: components/reading_list/offline_url_utils.cc
diff --git a/ios/chrome/browser/reading_list/offline_url_utils.cc b/components/reading_list/offline_url_utils.cc
similarity index 55%
copy from ios/chrome/browser/reading_list/offline_url_utils.cc
copy to components/reading_list/offline_url_utils.cc
index cc7d044c493471a1f3a008333b9648f87249bac1..fb028e391aed1d2957da5f85fde8054d5224cd1d 100644
--- a/ios/chrome/browser/reading_list/offline_url_utils.cc
+++ b/components/reading_list/offline_url_utils.cc
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ios/chrome/browser/reading_list/offline_url_utils.h"
+#include "components/reading_list/offline_url_utils.h"
#include "base/md5.h"
#include "base/strings/stringprintf.h"
-#include "ios/chrome/browser/chrome_url_constants.h"
namespace {
const char kOfflineDirectory[] = "Offline";
@@ -39,29 +38,4 @@ base::FilePath OfflinePageAbsolutePath(const base::FilePath& profile_path,
const GURL& url) {
return OfflineRootDirectoryPath(profile_path).Append(OfflinePagePath(url));
}
-
-GURL DistilledURLForPath(const base::FilePath& distilled_path) {
- if (distilled_path.empty()) {
- return GURL();
- }
- return GURL(kChromeUIOfflineURL + distilled_path.value());
-}
-
-GURL FileURLForDistilledURL(const GURL& distilled_url,
- const base::FilePath& profile_path,
- GURL* resources_root_url) {
- if (!distilled_url.is_valid()) {
- return GURL();
- }
- DCHECK(distilled_url.SchemeIs(kChromeUIScheme));
- base::FilePath offline_path = profile_path.AppendASCII(kOfflineDirectory);
-
- GURL file_url(base::StringPrintf("%s%s", url::kFileScheme,
- url::kStandardSchemeSeparator) +
- offline_path.value() + distilled_url.path());
- if (resources_root_url) {
- *resources_root_url = file_url.Resolve(".");
- }
- return file_url;
-}
}

Powered by Google App Engine
This is Rietveld 408576698