| 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 public void onFinishGetBitmap(Bitmap bitmap, int response) { | 998 public void onFinishGetBitmap(Bitmap bitmap, int response) { |
| 999 // Check whether this page is an offline page, and use i
ts online URL if so. | 999 // Check whether this page is an offline page, and use i
ts online URL if so. |
| 1000 String url = currentTab.getOriginalUrl(); | 1000 String url = currentTab.getOriginalUrl(); |
| 1001 RecordHistogram.recordBooleanHistogram( | 1001 RecordHistogram.recordBooleanHistogram( |
| 1002 "OfflinePages.SharedPageWasOffline", url != null
); | 1002 "OfflinePages.SharedPageWasOffline", url != null
); |
| 1003 | 1003 |
| 1004 // If there is no entry in the offline pages DB for this
tab, use the tab's | 1004 // If there is no entry in the offline pages DB for this
tab, use the tab's |
| 1005 // URL directly. | 1005 // URL directly. |
| 1006 if (url == null) url = currentTab.getUrl(); | 1006 if (url == null) url = currentTab.getUrl(); |
| 1007 | 1007 |
| 1008 ShareHelper.share( | 1008 ShareHelper.share(shareDirectly, true, mainActivity, cur
rentTab.getTitle(), |
| 1009 shareDirectly, mainActivity, currentTab.getTitle
(), url, bitmap); | 1009 null, url, bitmap, null); |
| 1010 if (shareDirectly) { | 1010 if (shareDirectly) { |
| 1011 RecordUserAction.record("MobileMenuDirectShare"); | 1011 RecordUserAction.record("MobileMenuDirectShare"); |
| 1012 } else { | 1012 } else { |
| 1013 RecordUserAction.record("MobileMenuShare"); | 1013 RecordUserAction.record("MobileMenuShare"); |
| 1014 } | 1014 } |
| 1015 } | 1015 } |
| 1016 }; | 1016 }; |
| 1017 if (isIncognito || currentTab.getWebContents() == null) { | 1017 if (isIncognito || currentTab.getWebContents() == null) { |
| 1018 callback.onFinishGetBitmap(null, ReadbackResponse.SURFACE_UNAVAILABL
E); | 1018 callback.onFinishGetBitmap(null, ReadbackResponse.SURFACE_UNAVAILABL
E); |
| 1019 } else { | 1019 } else { |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", | 1765 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", |
| 1766 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); | 1766 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); |
| 1767 | 1767 |
| 1768 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { | 1768 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { |
| 1769 RecordHistogram.recordLinearCountHistogram( | 1769 RecordHistogram.recordLinearCountHistogram( |
| 1770 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp,
1, | 1770 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp,
1, |
| 1771 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); | 1771 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); |
| 1772 } | 1772 } |
| 1773 } | 1773 } |
| 1774 } | 1774 } |
| OLD | NEW |