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

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

Issue 2100043004: [Offline pages] Filter out pages cached by different tabs on tab helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updating comment to address CR Created 4 years, 6 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 82f5ff7dac3df53f1214c553f30a50effadaff27..6320e525fe41a039c7f4ba13623ac1a83d2caf80 100644
--- a/chrome/browser/android/offline_pages/offline_page_utils.cc
+++ b/chrome/browser/android/offline_pages/offline_page_utils.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h"
#include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
#include "chrome/browser/android/offline_pages/offline_page_tab_helper.h"
+#include "chrome/browser/android/tab_android.h"
#include "components/offline_pages/offline_page_feature.h"
#include "components/offline_pages/offline_page_item.h"
#include "components/offline_pages/offline_page_model.h"
@@ -176,4 +177,14 @@ const OfflinePageItem* OfflinePageUtils::GetOfflinePageFromWebContents(
return tab_helper ? tab_helper->offline_page() : nullptr;
}
+// 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;
+}
+
} // namespace offline_pages
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_utils.h ('k') | chrome/browser/android/offline_pages/recent_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698