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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java

Issue 2202423004: [Offline Page]Enable share offline page from online tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newBranchOnTryout
Patch Set: Patch to land Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/offlinepages/ClientId.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
index 6ae8c1ee913bc9da9eecbe66075f31fe61e647bd..1fcf1efb702c1a9e20f8595e5ddc1c7d8b35e79c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -1001,23 +1001,19 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
public void onFinishGetBitmap(Bitmap bitmap, int response) {
// Check whether this page is an offline page, and use its online URL if so.
OfflinePageItem offlinePage = currentTab.getOfflinePage();
- String url = currentTab.getOriginalUrl();
+ String onlineUrl = currentTab.getOriginalUrl();
RecordHistogram.recordBooleanHistogram(
"OfflinePages.SharedPageWasOffline", offlinePage != null);
- boolean canShareOfflinePage =
- (offlinePage != null && OfflinePageBridge.isPageSharingEnabled());
+ boolean canShareOfflinePage = OfflinePageBridge.isPageSharingEnabled();
if (canShareOfflinePage) {
// Share the offline page instead of the URL.
- OfflinePageUtils.shareOfflinePage(
- shareDirectly, true, mainActivity, null, url, bitmap, null, currentTab);
+ boolean isOfflinePage = (offlinePage != null);
+ OfflinePageUtils.shareOfflinePage(shareDirectly, true, mainActivity, null,
+ onlineUrl, bitmap, null, currentTab, isOfflinePage);
} else {
- // If there is no entry in the offline pages DB for this tab, use the
- // tab's URL directly.
- if (url == null) url = currentTab.getUrl();
-
ShareHelper.share(shareDirectly, true, mainActivity, currentTab.getTitle(),
- null, url, null, bitmap, null);
+ null, onlineUrl, null, bitmap, null);
if (shareDirectly) {
RecordUserAction.record("MobileMenuDirectShare");
} else {
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/offlinepages/ClientId.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698