Commit c61f1d05 authored by Matt Jones's avatar Matt Jones Committed by Commit Bot

Remove most use of TabModelSelector and ChromeActivity in ReaderModeManager

This patch replaces most usages of the TabModelSelector with Tab to
facilitate the transition of the ReaderModeManager to be a per-tab
object. The patch also includes a few other mechanical changes around
accessing the web contents and removes some now unnecessary null
checks.

Bug: 1069815, 1051184
Change-Id: Ica37a9781fd299494403174f46aa5b3a9c27939e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147675
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759812}
parent 76e26f31
...@@ -746,7 +746,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent> ...@@ -746,7 +746,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
} }
if (ReaderModeManager.isEnabled(this)) { if (ReaderModeManager.isEnabled(this)) {
mReaderModeManager = new ReaderModeManager(getTabModelSelector(), this); mReaderModeManager = new ReaderModeManager(getTabModelSelector());
} }
TraceEvent.end("ChromeActivity:CompositorInitialization"); TraceEvent.end("ChromeActivity:CompositorInitialization");
......
...@@ -89,7 +89,7 @@ public class ReaderModeInfoBar extends InfoBar { ...@@ -89,7 +89,7 @@ public class ReaderModeInfoBar extends InfoBar {
@Override @Override
public void onCloseButtonClicked() { public void onCloseButtonClicked() {
if (getReaderModeManager() != null) { if (getReaderModeManager() != null) {
getReaderModeManager().onClosed(StateChangeReason.CLOSE_BUTTON); getReaderModeManager().onClosed(getTab(), StateChangeReason.CLOSE_BUTTON);
} }
super.onCloseButtonClicked(); super.onCloseButtonClicked();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment