Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 // returned pointer is owned by the web_contents and may be deleted by user | 37 // returned pointer is owned by the web_contents and may be deleted by user |
| 38 // navigation, so it is unsafe to store a copy of the returned pointer. | 38 // navigation, so it is unsafe to store a copy of the returned pointer. |
| 39 static const OfflinePageItem* GetOfflinePageFromWebContents( | 39 static const OfflinePageItem* GetOfflinePageFromWebContents( |
| 40 content::WebContents* web_contents); | 40 content::WebContents* web_contents); |
| 41 | 41 |
| 42 // Gets the offline header provided when loading the offline page for the | 42 // Gets the offline header provided when loading the offline page for the |
| 43 // given web contents. | 43 // given web contents. |
| 44 static const OfflinePageHeader* GetOfflineHeaderFromWebContents( | 44 static const OfflinePageHeader* GetOfflineHeaderFromWebContents( |
| 45 content::WebContents* web_contents); | 45 content::WebContents* web_contents); |
| 46 | 46 |
| 47 // Returns whether the offline page corresponding to |web_contents| is part of | |
|
jianli
2016/10/25 22:14:16
The comment is a bit hard to understand. How about
RyanSturm
2016/10/25 23:08:26
Done.
| |
| 48 // previews/. If there is no offline page for |web_contents|, returns false. | |
| 49 static bool IsShowingOfflinePreview(content::WebContents* web_contents); | |
| 50 | |
| 47 // Gets an Android Tab ID from a tab containing |web_contents|. Returns false, | 51 // Gets an Android Tab ID from a tab containing |web_contents|. Returns false, |
| 48 // when tab is not available. Returns true otherwise and sets |tab_id| to the | 52 // when tab is not available. Returns true otherwise and sets |tab_id| to the |
| 49 // ID of the tab. | 53 // ID of the tab. |
| 50 static bool GetTabId(content::WebContents* web_contents, int* tab_id); | 54 static bool GetTabId(content::WebContents* web_contents, int* tab_id); |
| 51 | 55 |
| 52 static void CheckExistenceOfPagesWithURL( | 56 static void CheckExistenceOfPagesWithURL( |
| 53 content::BrowserContext* browser_context, | 57 content::BrowserContext* browser_context, |
| 54 const std::string name_space, | 58 const std::string name_space, |
| 55 const GURL& offline_url, | 59 const GURL& offline_url, |
| 56 const base::Callback<void(bool)>& callback); | 60 const base::Callback<void(bool)>& callback); |
| 57 | 61 |
| 58 static void CheckExistenceOfRequestsWithURL( | 62 static void CheckExistenceOfRequestsWithURL( |
| 59 content::BrowserContext* browser_context, | 63 content::BrowserContext* browser_context, |
| 60 const std::string name_space, | 64 const std::string name_space, |
| 61 const GURL& offline_page_url, | 65 const GURL& offline_page_url, |
| 62 const base::Callback<void(bool)>& callback); | 66 const base::Callback<void(bool)>& callback); |
| 63 | 67 |
| 64 static bool EqualsIgnoringFragment(const GURL& lhs, const GURL& rhs); | 68 static bool EqualsIgnoringFragment(const GURL& lhs, const GURL& rhs); |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // namespace offline_pages | 71 } // namespace offline_pages |
| 68 | 72 |
| 69 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 73 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| OLD | NEW |