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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/readermode/ReaderModePanel.java

Issue 2510093004: Test that base page is available in Reader Mode (Closed)
Patch Set: Created 4 years, 1 month 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 | no next file » | 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/compositor/bottombar/readermode/ReaderModePanel.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/readermode/ReaderModePanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/readermode/ReaderModePanel.java
index d83ec64e09761e556f06bfa10fa12f6787b89b67..0b517df649530241a0aaf276e69d5bcaeaa0a027 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/readermode/ReaderModePanel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/readermode/ReaderModePanel.java
@@ -86,10 +86,16 @@ public class ReaderModePanel extends OverlayPanel {
mContentViewDelegate.setOverlayPanelContentViewCore(contentView);
WebContents distilledWebContents = contentView.getWebContents();
- if (distilledWebContents == null) return;
+ if (distilledWebContents == null) {
+ closePanel(StateChangeReason.UNKNOWN, false);
+ return;
+ }
WebContents sourceWebContents = mManagerDelegate.getBasePageWebContents();
- if (sourceWebContents == null) return;
+ if (sourceWebContents == null) {
+ closePanel(StateChangeReason.UNKNOWN, false);
+ return;
+ }
DomDistillerTabUtils.distillAndView(sourceWebContents, distilledWebContents);
}
@@ -255,7 +261,7 @@ public class ReaderModePanel extends OverlayPanel {
if (!mTimerRunning && animatingToOpenState) {
mStartTime = System.currentTimeMillis();
mTimerRunning = true;
- if (mManagerDelegate != null) {
+ if (mManagerDelegate != null && mManagerDelegate.getBasePageWebContents() != null) {
String url = mManagerDelegate.getBasePageWebContents().getUrl();
RapporServiceBridge.sampleDomainAndRegistryFromURL(
"DomDistiller.OpenPanel", url);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698