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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeTabInfo.java

Issue 1436743002: Integrate new Reader Mode panel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scene-layer-changes
Patch Set: findbugs and low-end devices Created 5 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
Index: chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeTabInfo.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeTabInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeTabInfo.java
new file mode 100644
index 0000000000000000000000000000000000000000..cc389ecd0a6ee08c3ba0e6f437d670acd2559fe9
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeTabInfo.java
@@ -0,0 +1,82 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.dom_distiller;
+
+import org.chromium.content_public.browser.WebContentsObserver;
+
+/**
+ * This class tracks the per-tab state of reader mode.
+ */
+public class ReaderModeTabInfo {
+ // The WebContentsObserver responsible for updates to the distillation status of the tab.
+ private WebContentsObserver mWebContentsObserver;
+
+ // The distillation status of the tab.
+ private int mStatus;
+
+ // If the panel was closed due to the close button.
+ private boolean mIsDismissed;
+
+ // The URL that distiller is using for this tab. This is used to check if a result comes
+ // back from distiller and the user has already loaded a new URL.
+ private String mCurrentUrl;
+
+ /**
+ * @param observer The WebContentsObserver for the tab this object represents.
+ */
+ public void setWebContentsObserver(WebContentsObserver observer) {
+ mWebContentsObserver = observer;
+ }
+
+ /**
+ * @return The WebContentsObserver for the tab this object represents.
+ */
+ public WebContentsObserver getWebContentsObserver() {
+ return mWebContentsObserver;
+ }
+
+ /**
+ * @param status The status of reader mode for this object's tab.
+ */
+ public void setStatus(int status) {
+ mStatus = status;
+ }
+
+ /**
+ * @return The reader mode status for this object's tab.
+ */
+ public int getStatus() {
+ return mStatus;
+ }
+
+ /**
+ * @return If the panel has been dismissed for this object's tab.
+ */
+ public boolean isDismissed() {
+ return mIsDismissed;
+ }
+
+ /**
+ * @param dismissed Set the panel as dismissed for this object's tab.
+ */
+ public void setIsDismissed(boolean dismissed) {
+ mIsDismissed = dismissed;
+ }
+
+ /**
+ * @param url The URL being processed by reader mode.
+ */
+ public void setUrl(String url) {
+ mCurrentUrl = url;
+ }
+
+ /**
+ * @return The last URL being processed by reader mode.
+ */
+ public String getUrl() {
+ return mCurrentUrl;
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698