| 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 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |