hterm: Announce the current screen content on Page up/down

This CL causes the current screen content to be announced as the
previous rows of content are paged through. It will interrupt existing
announcements when it is read out.

Bug: 822490, 646690
Change-Id: I6ab9bf594b6ca8abc32666ccc2235dd82b5fb36f
Reviewed-on: https://chromium-review.googlesource.com/1078047
Tested-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/hterm/js/hterm_terminal.js b/hterm/js/hterm_terminal.js
index c2909c8..ed7207f 100644
--- a/hterm/js/hterm_terminal.js
+++ b/hterm/js/hterm_terminal.js
@@ -115,10 +115,6 @@
   // The AccessibilityReader object for announcing command output.
   this.accessibilityReader_ = null;
 
-  // Whether command output should be rendered for Assistive Technology.
-  // This isn't always enabled because it has an impact on performance.
-  this.accessibilityEnabled_ = false;
-
   // All terminal bell notifications that have been generated (not necessarily
   // shown).
   this.bellNotificationList_ = [];
@@ -1202,8 +1198,7 @@
  * position.
  */
 hterm.Terminal.prototype.scrollPageUp = function() {
-  var i = this.scrollPort_.getTopRowIndex();
-  this.scrollPort_.scrollRowToTop(i - this.screenSize.height + 1);
+  this.scrollPort_.scrollPageUp();
 };
 
 /**
@@ -1211,8 +1206,7 @@
  * position.
  */
 hterm.Terminal.prototype.scrollPageDown = function() {
-  var i = this.scrollPort_.getTopRowIndex();
-  this.scrollPort_.scrollRowToTop(i + this.screenSize.height - 1);
+  this.scrollPort_.scrollPageDown();
 };
 
 /**
@@ -1454,6 +1448,7 @@
       this.prefs_.get('background-position'));
   this.scrollPort_.setUserCssUrl(this.prefs_.get('user-css'));
   this.scrollPort_.setUserCssText(this.prefs_.get('user-css-text'));
+  this.scrollPort_.setAccessibilityReader(this.accessibilityReader_);
 
   this.div_.focus = this.focus.bind(this);
 
@@ -1792,9 +1787,7 @@
  */
 hterm.Terminal.prototype.print = function(str) {
   // Basic accessibility output for the screen reader.
-  if (this.accessibilityEnabled_) {
-    this.accessibilityReader_.announce(str);
-  }
+  this.accessibilityReader_.announce(str);
 
   var startOffset = 0;
 
@@ -2313,8 +2306,7 @@
  * @param {boolean} enabled Whether to enable accessibility-friendly features.
  */
 hterm.Terminal.prototype.setAccessibilityEnabled = function(enabled) {
-  this.accessibilityEnabled_ = enabled;
-  this.scrollPort_.setAccessibilityEnabled(enabled);
+  this.accessibilityReader_.setAccessibilityEnabled(enabled);
 };
 
 /**