Chromium Code Reviews| 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..cbd255b1fb45d733aba10eb9719a0076b8f658dc |
| --- /dev/null |
| +++ b/chrome/browser/android/offline_pages/offline_page_utils.h |
| @@ -0,0 +1,52 @@ |
| +// 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; |
| + |
| +namespace android { |
| + |
| +// Returns true if |url| might points to an offline page. |
|
dewittj
2015/12/15 00:59:25
nit: might point to
fgorski
2015/12/15 16:33:01
Done.
|
| +bool MightBeOfflineURL(const GURL& url); |
| + |
| +// Gets an offline URL of an offline page with |online_url| if one is present in |
| +// the |browser_context|. |
| +GURL GetOfflineURLByOnlineURL(content::BrowserContext* browser_context, |
|
dewittj
2015/12/15 00:59:25
Nit: If not too much work, s/By/From/ would make t
fgorski
2015/12/15 16:33:01
This adheres to the naming convention used by the
|
| + const GURL& online_url); |
| + |
| +// Gets an online URL of an offline page with |offline_url| if one is present in |
| +// the |browser_context|. |
| +GURL GetOnlineURLByOfflineURL(content::BrowserContext* browser_context, |
| + const GURL& offline_url); |
| + |
| +// Gets a bookmark ID related to the |offline_url|. |
| +int64 GetBookmarkIdByOfflineURL(content::BrowserContext* browser_context, |
| + const GURL& offline_url); |
| + |
| +// Checks whether a give |offline_url| points to an offline page. |
| +bool IsOfflinePage(content::BrowserContext* browser_context, |
| + const GURL& offline_url); |
| + |
| +// Checks whether a given |online_url| has a related offline page. |
| +bool HasOfflinePageForOnlineURL(content::BrowserContext* browser_context, |
| + const GURL& online_url); |
| + |
| +// Checks if there are any offline pages saved in the |browser_context| |
| +const bool HasOfflinePages(content::BrowserContext* browser_context); |
| + |
| +} // namespace android |
| +} // namespace offline_pages |
| + |
| +#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |