| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // returned pointer is owned by the web_contents and may be deleted by user | 60 // returned pointer is owned by the web_contents and may be deleted by user |
| 61 // navigation, so it is unsafe to store a copy of the returned pointer. | 61 // navigation, so it is unsafe to store a copy of the returned pointer. |
| 62 static const OfflinePageItem* GetOfflinePageFromWebContents( | 62 static const OfflinePageItem* GetOfflinePageFromWebContents( |
| 63 content::WebContents* web_contents); | 63 content::WebContents* web_contents); |
| 64 | 64 |
| 65 // Gets the offline header provided when loading the offline page for the | 65 // Gets the offline header provided when loading the offline page for the |
| 66 // given web contents. | 66 // given web contents. |
| 67 static const OfflinePageHeader* GetOfflineHeaderFromWebContents( | 67 static const OfflinePageHeader* GetOfflineHeaderFromWebContents( |
| 68 content::WebContents* web_contents); | 68 content::WebContents* web_contents); |
| 69 | 69 |
| 70 // Returns whether the offline page corresponding to |web_contents| is part of |
| 71 // previews/. If there is no offline page for |web_contents|, returns false. |
| 72 static bool IsShowingOfflinePreview(content::WebContents* web_contents); |
| 73 |
| 70 // Gets an Android Tab ID from a tab containing |web_contents|. Returns false, | 74 // Gets an Android Tab ID from a tab containing |web_contents|. Returns false, |
| 71 // when tab is not available. Returns true otherwise and sets |tab_id| to the | 75 // when tab is not available. Returns true otherwise and sets |tab_id| to the |
| 72 // ID of the tab. | 76 // ID of the tab. |
| 73 static bool GetTabId(content::WebContents* web_contents, int* tab_id); | 77 static bool GetTabId(content::WebContents* web_contents, int* tab_id); |
| 74 }; | 78 }; |
| 75 | 79 |
| 76 } // namespace offline_pages | 80 } // namespace offline_pages |
| 77 | 81 |
| 78 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 82 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| OLD | NEW |