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

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

Issue 2362033002: Showing previews UI for Offline Previews (Closed)
Patch Set: java fixes for mocking methods Created 4 years, 2 months 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.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_utils.cc b/chrome/browser/android/offline_pages/offline_page_utils.cc
index e8292101d5c1867ad1ce1e644410213b732c3006..887a2eaf08afa4a10d6072523b0f83da40f61187 100644
--- a/chrome/browser/android/offline_pages/offline_page_utils.cc
+++ b/chrome/browser/android/offline_pages/offline_page_utils.cc
@@ -102,20 +102,28 @@ const OfflinePageItem* OfflinePageUtils::GetOfflinePageFromWebContents(
// static
const OfflinePageHeader* OfflinePageUtils::GetOfflineHeaderFromWebContents(
content::WebContents* web_contents) {
OfflinePageTabHelper* tab_helper =
OfflinePageTabHelper::FromWebContents(web_contents);
return tab_helper ? &(tab_helper->offline_header()) : nullptr;
}
// static
+bool OfflinePageUtils::IsShowingOfflinePreview(
+ content::WebContents* web_contents) {
+ OfflinePageTabHelper* tab_helper =
+ OfflinePageTabHelper::FromWebContents(web_contents);
+ return tab_helper && tab_helper->IsShowingOfflinePreview();
+}
+
+// static
bool OfflinePageUtils::GetTabId(content::WebContents* web_contents,
int* tab_id) {
TabAndroid* tab_android = TabAndroid::FromWebContents(web_contents);
if (!tab_android)
return false;
*tab_id = tab_android->GetAndroidId();
return true;
}
// static

Powered by Google App Engine
This is Rietveld 408576698