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

Unified Diff: chrome/browser/android/offline_pages/offline_page_utils.h

Issue 1521193002: [Offline pages] Refactor URL conversions from TabAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing final CR feedback Created 5 years 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: chrome/browser/android/offline_pages/offline_page_utils.h
diff --git a/chrome/browser/android/offline_pages/offline_page_utils.h b/chrome/browser/android/offline_pages/offline_page_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..54ef11711508011d0adb5b0092eb31711da22b3c
--- /dev/null
+++ b/chrome/browser/android/offline_pages/offline_page_utils.h
@@ -0,0 +1,54 @@
+// Copyright 2015 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 CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_
+#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_
+
+#include "base/basictypes.h"
+
+class GURL;
+
+namespace content {
+class BrowserContext;
+}
+
+namespace offline_pages {
+struct OfflinePageItem;
+
+class OfflinePageUtils {
+ public:
+ // Returns true if |url| might point to an offline page.
+ static bool MightBeOfflineURL(const GURL& url);
+
+ // Gets an offline URL of an offline page with |online_url| if one exists.
+ static GURL GetOfflineURLForOnlineURL(
+ content::BrowserContext* browser_context,
+ const GURL& online_url);
+
+ // Gets an online URL of an offline page with |offline_url| if one exists.
+ static GURL GetOnlineURLForOfflineURL(
+ content::BrowserContext* browser_context,
+ const GURL& offline_url);
+
+ // Gets a bookmark ID related to the |offline_url|.
+ static int64 GetBookmarkIdForOfflineURL(
+ content::BrowserContext* browser_context,
+ const GURL& offline_url);
+
+ // Checks whether |offline_url| points to an offline page.
+ static bool IsOfflinePage(content::BrowserContext* browser_context,
+ const GURL& offline_url);
+
+ // Checks whether offline page for |online_url| exists.
+ static bool HasOfflinePageForOnlineURL(
+ content::BrowserContext* browser_context,
+ const GURL& online_url);
+
+ // Checks whether any offline page is saved.
+ static const bool HasOfflinePages(content::BrowserContext* browser_context);
+};
+
+} // namespace offline_pages
+
+#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698