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

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

Issue 2241303002: Revert of navigator.share: Resolve promise only after user chooses a target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 package org.chromium.chrome.browser; 5 package org.chromium.chrome.browser;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.app.Activity; 9 import android.app.Activity;
10 import android.app.SearchManager; 10 import android.app.SearchManager;
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 public void onFinishGetBitmap(Bitmap bitmap, int response) { 985 public void onFinishGetBitmap(Bitmap bitmap, int response) {
986 // Check whether this page is an offline page, and use i ts online URL if so. 986 // Check whether this page is an offline page, and use i ts online URL if so.
987 String url = currentTab.getOriginalUrl(); 987 String url = currentTab.getOriginalUrl();
988 RecordHistogram.recordBooleanHistogram( 988 RecordHistogram.recordBooleanHistogram(
989 "OfflinePages.SharedPageWasOffline", url != null ); 989 "OfflinePages.SharedPageWasOffline", url != null );
990 990
991 // If there is no entry in the offline pages DB for this tab, use the tab's 991 // If there is no entry in the offline pages DB for this tab, use the tab's
992 // URL directly. 992 // URL directly.
993 if (url == null) url = currentTab.getUrl(); 993 if (url == null) url = currentTab.getUrl();
994 994
995 ShareHelper.share(shareDirectly, true, mainActivity, cur rentTab.getTitle(), 995 ShareHelper.share(
996 null, url, bitmap, null); 996 shareDirectly, mainActivity, currentTab.getTitle (), url, bitmap);
997 if (shareDirectly) { 997 if (shareDirectly) {
998 RecordUserAction.record("MobileMenuDirectShare"); 998 RecordUserAction.record("MobileMenuDirectShare");
999 } else { 999 } else {
1000 RecordUserAction.record("MobileMenuShare"); 1000 RecordUserAction.record("MobileMenuShare");
1001 } 1001 }
1002 } 1002 }
1003 }; 1003 };
1004 if (isIncognito || currentTab.getWebContents() == null) { 1004 if (isIncognito || currentTab.getWebContents() == null) {
1005 callback.onFinishGetBitmap(null, ReadbackResponse.SURFACE_UNAVAILABL E); 1005 callback.onFinishGetBitmap(null, ReadbackResponse.SURFACE_UNAVAILABL E);
1006 } else { 1006 } else {
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1766 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", 1766 "Android.MultiWindowMode.IsTabletScreenWidthBelow600",
1767 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); 1767 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP);
1768 1768
1769 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { 1769 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) {
1770 RecordHistogram.recordLinearCountHistogram( 1770 RecordHistogram.recordLinearCountHistogram(
1771 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp, 1, 1771 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp, 1,
1772 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); 1772 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50);
1773 } 1773 }
1774 } 1774 }
1775 } 1775 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698