| 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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 PrintingController printingController = getChromeApplication().getPrinti
ngController(); | 990 PrintingController printingController = getChromeApplication().getPrinti
ngController(); |
| 991 if (printingController != null && !currentTab.isNativePage() && !printin
gController.isBusy() | 991 if (printingController != null && !currentTab.isNativePage() && !printin
gController.isBusy() |
| 992 && PrefServiceBridge.getInstance().isPrintingEnabled()) { | 992 && PrefServiceBridge.getInstance().isPrintingEnabled()) { |
| 993 PrintShareActivity.enablePrintShareOption(this); | 993 PrintShareActivity.enablePrintShareOption(this); |
| 994 } | 994 } |
| 995 | 995 |
| 996 final Activity mainActivity = this; | 996 final Activity mainActivity = this; |
| 997 ContentBitmapCallback callback = new ContentBitmapCallback() { | 997 ContentBitmapCallback callback = new ContentBitmapCallback() { |
| 998 @Override | 998 @Override |
| 999 public void onFinishGetBitmap(Bitmap bitmap, int response) { | 999 public void onFinishGetBitmap(Bitmap bitmap, int response) { |
| 1000 // Check whether this page is an offline page, and use i
ts online URL if so. | |
| 1001 String url = currentTab.getOriginalUrl(); | |
| 1002 RecordHistogram.recordBooleanHistogram( | 1000 RecordHistogram.recordBooleanHistogram( |
| 1003 "OfflinePages.SharedPageWasOffline", url != null
); | 1001 "OfflinePages.SharedPageWasOffline", currentTab.
isOfflinePage()); |
| 1004 | |
| 1005 // If there is no entry in the offline pages DB for this
tab, use the tab's | |
| 1006 // URL directly. | |
| 1007 if (url == null) url = currentTab.getUrl(); | |
| 1008 | 1002 |
| 1009 ShareHelper.share( | 1003 ShareHelper.share( |
| 1010 shareDirectly, mainActivity, currentTab.getTitle
(), url, bitmap); | 1004 shareDirectly, mainActivity, currentTab.getTitle
(), |
| 1005 currentTab.getUrl(), bitmap); |
| 1011 if (shareDirectly) { | 1006 if (shareDirectly) { |
| 1012 RecordUserAction.record("MobileMenuDirectShare"); | 1007 RecordUserAction.record("MobileMenuDirectShare"); |
| 1013 } else { | 1008 } else { |
| 1014 RecordUserAction.record("MobileMenuShare"); | 1009 RecordUserAction.record("MobileMenuShare"); |
| 1015 } | 1010 } |
| 1016 } | 1011 } |
| 1017 }; | 1012 }; |
| 1018 if (isIncognito || currentTab.getWebContents() == null) { | 1013 if (isIncognito || currentTab.getWebContents() == null) { |
| 1019 callback.onFinishGetBitmap(null, ReadbackResponse.SURFACE_UNAVAILABL
E); | 1014 callback.onFinishGetBitmap(null, ReadbackResponse.SURFACE_UNAVAILABL
E); |
| 1020 } else { | 1015 } else { |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", | 1765 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", |
| 1771 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); | 1766 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); |
| 1772 | 1767 |
| 1773 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { | 1768 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { |
| 1774 RecordHistogram.recordLinearCountHistogram( | 1769 RecordHistogram.recordLinearCountHistogram( |
| 1775 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp,
1, | 1770 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp,
1, |
| 1776 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); | 1771 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); |
| 1777 } | 1772 } |
| 1778 } | 1773 } |
| 1779 } | 1774 } |
| OLD | NEW |