lib_wam: Switch direct transport to promises.

The async guarantee of lib.wam.DirectTransport was setTimeout
based, which comes with a perf penalty.  Switching to
Promises fixes that.

Change-Id: Ief1cfe224e93135c2d0be0f5104264b43eb14579
Reviewed-on: https://chromium-review.googlesource.com/187710
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.30: Scrolling speedups.

* hterm_scrollport.js: Cache screen size.  The getBoundingClientRect call
  dominated profiles of `cat /var/log/messages`.  Now we determine the screen
  size after each resize event and cache the result for later.
* hterm_scrollport.js: Remove calls to syncScrollHeight and
  syncRowNodesDimensions from redraw_, since they're expensive and redraw_
  is called a lot, and those things should only change during resize/font-size
  changes.

Change-Id: Iff0652ea5e54fef6b70da8e6a815223ff5f839dc
Reviewed-on: https://chromium-review.googlesource.com/187010
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
nassh: Fix undefined var reference in google relay

Change-Id: I16c5573e6f832552e61c9cd721dda79e07b4322b
Reviewed-on: https://chromium-review.googlesource.com/187711
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
nassh 0.8.26.1: Fix google relay, hterm 1.30, libdot 1.6

* Fix undefined var in nassh_stream_google_relay.js.
* Update to hterm 1.30 for scrollport speedups.
* Update to libdot 1.6 for pref manager fixes.

Change-Id: I7e2d873b1879c42f3029e29282d89d78644c94fc
Reviewed-on: https://chromium-review.googlesource.com/187785
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
libdot: lib.PreferenceManager fixes.

* diff() and onStorageChanged had issues dealing with boolean prefs
  and the change-to-default-value case.  The upshot was that
  set(name, true/false/DEFAULT_VALUE) caused the notifyChange to be called
  twice.

Change-Id: I5d732aeda9fde6088bbbe1b956f2cfa52b7264a5
Reviewed-on: https://chromium-review.googlesource.com/187784
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Commit-Queue: Marvelous Marius <mschilder@chromium.org>
Tested-by: Marvelous Marius <mschilder@chromium.org>
Revert "hterm 1.30: Scrolling speedups."

This caused issues when scrolling selectio off screen.  I'm
not sure why and don't have the time to track it down at the
moment.

This reverts commit e3f4e3b6727532d7e9f7a70a2662f65301ef584e.

Change-Id: I780ff539cc79d3bdd2e60cdc5b7adb82e3c3eb77
Reviewed-on: https://chromium-review.googlesource.com/188799
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Commit-Queue: Marvelous Marius <mschilder@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm: auto-copy fix again

1.30, 2014-03-04, Even better recursive "copy" fix.

* BUG=chromium:340699: Auto copy doesn't work.
  Now I see why the "select bags" aren't enough.  Even for the simplest case
  where we're copying an on-screen selection we need to use
  Terminal.prototype.copySelectionToClipboard to handle copy of wrapped lines.
  This fix reverts the changes from 1.28 and 1.29 in favor of just scheduling
  the copy on a timeout, which defeats the recursive copy blocker.
* Revert "Scrolling Speedups" change (which never got a distinct hterm version
  number).  This caused issues with selections scrolled out of the visible area.

Change-Id: I0f77b50408f6dff4f1256bc297a485e070afb582
Reviewed-on: https://chromium-review.googlesource.com/188820
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Commit-Queue: Marvelous Marius <mschilder@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
hterm 0.8.26.2, Update to hterm 1.30 (for real)

* Update to hterm 1.30 for "scrolling speedups" revert (fixes scrolling selected
  text off screen), and copy/paste of wrapped lines fix.

(Previous commit mentioned hterm 1.30, but the hterm version number had not
actually changed with the "scrolling speedups" patch.)

Change-Id: I562d1ff1e642c7104dad6ba2b6d8dda9f5da2d84
Reviewed-on: https://chromium-review.googlesource.com/188881
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.31: a new zoom warning

* Re-implement zoom detection in terms of the currentScale property of svg
  elements.  This requires the svg element to be in the topmost document,
  or at least not in the "about:blank" document that the scrollport creates
  so it may not be perfect, but it's better than nothing.

Change-Id: I57fb9fea24e0c9743b5abac695213333e356f022
Reviewed-on: https://chromium-review.googlesource.com/188911
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.32: Disable local select in all mouse reporting modes.

* Previously we allowed "local" selection (that which happens by default in
  Chrome) to stay enabled for mouse mode 1001 (report mouseup/down only).  This
  caused a few issues.  I didn't realize at the time that emacs used this
  mouseup/down positions to set an active region, which conflicts with the
  local selection.  You tend wind up with a confusing partial overlap of the two
  selections.  Additionally, with copy-on-select enabled, the mouseup event
  was consumed by the terminal and never sent to the host.

  This change disables local selection when we're in mode 1001.  Local selection
  was disabled in mode 1002, report mousedown/up/movement, which is preferred
  by vi.

  Our "mouse-cell-motion-trick" was all about allowing local selection in mode
  1002, so that's been removed too.  I doubt this preference was widely used.

  The change adds the ability to use alt-click to override the current mouse
  state, so that you can make a local selection even while in mode 1001/1002.
  Alt was chosen as its the only modifier key which can't be sent with a
  mouse event, though if you're depending on alt === meta, you'll lose
  the ability to send meta-mouse sequences.  If your local window manager
  already maps alt-click to something, then you can add any other modifier in
  addition to alt (say, alt-ctrl-mousedown) to defeat your existing binding.

Change-Id: If03b2c1242be84f3ce62156f9cd23ef3c7b965e5
Reviewed-on: https://chromium-review.googlesource.com/188923
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
nassh 0.8.26.3: Update to hterm 1.32.

* Update to hterm 1.32 for zoom warning and mouse selection fixes.

Change-Id: Ida8e77a32680815d5f9da9482e70714aff799f91
Reviewed-on: https://chromium-review.googlesource.com/189057
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.33: Fix user-css merge lossage.

* A previous merge lost the user-css pref changes to hterm_terminal.js.

Change-Id: I79693dddb4ea9960ddf223f4f456a16173ad2d0b
Reviewed-on: https://chromium-review.googlesource.com/190068
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Commit-Queue: Marvelous Marius <mschilder@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.34: Add ctrl-plus-minus-zero-zoom preference.

* In the default state (true) hterm works the same as before.  If set to
  false, ctrl-shift-plus/minus/zero controls zoom, and ctrl-minus sends ^_.

Change-Id: Ie35eee99173e8ba003e23008038689936c62d524
Reviewed-on: https://chromium-review.googlesource.com/190069
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Commit-Queue: Marvelous Marius <mschilder@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
lib_wam: Remove isFinalReply from the message

lib_wam_message.js:
* Remove the isFinalReply property from the message sent over
  the wire.  Instead messages named 'ok' and 'error' always
  imply isFinalReply.

lib_wam_direct_transport.js:
* Check the queue length before firing the servicePromise_,
  otherwise we end up servicing the queue too many times.

Change-Id: Iaae2ead093facc01d9a1dbfb11c04d810a636ccb
Reviewed-on: https://chromium-review.googlesource.com/190090
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
nassh: rewrite options page to be more Chrome like

Use the chrome-bootstrap project to get an options page that looks like
standard Chrome options pages.

We also change the theming behavior so that instead of modfiying the
current page, we actually create a small hterm window.  Now people can
see what the settings will look like, and we don't have to duplicate
the settings mappings ourselves.

BUG=None
TEST=looked at the options page

Change-Id: I4bfa9457dbc01fc0c027e1aa661c1e436cbcc8a5
Reviewed-on: https://chromium-review.googlesource.com/191016
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.35: Add enable-bold-as-bright preference.

* Adds a preference to control whether or not the bold attribute from ESC
  "[ ... m" sequences also triggers bright colors.  Preference is on by default
  to match the behavior of xterm and previous versions of hterm.  Switch it
  off to enable bold font face in non-bright colors.  This is especially useful
  if you've overidden your 16 color palette to something other than the
  typical 8-dark/8-bright scheme.

Change-Id: Ica78153b2835652851493222c1c3031bc1260a03
Reviewed-on: https://chromium-review.googlesource.com/191511
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
nassh 0.8.26.5: hterm 1.35, new options page

* Update to hterm 1.35 for enable-bold-as-bright preference.
* Rewrite options page to be more Chrome like.
* Fix new options page to track terminal profile changes.
* Update to hterm 1.34 for user-css and ctrl-plus-minus-zero-zoom prefs.

Change-Id: I8d167686df57574353366027859b6e78009089ac
Reviewed-on: https://chromium-review.googlesource.com/191451
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
nassh 0.8.26.6: Options page initialization fix.

* Reorder options page initialization so that it actually works.

Change-Id: I48f0277a1259ddb1f2ce0da0a0ebb46f84d5b73d
Reviewed-on: https://chromium-review.googlesource.com/191522
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Moved lib.fs deps from hterm to nashh and orders it correctly for real this time.

Change-Id: I73efcc91226edde21744f26383f9bde2975183fc
Reviewed-on: https://chromium-review.googlesource.com/192134
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
ssh-agent plumbing on the nassh side.

The NaCl plugin bubbles up connect requests for ssh-agent which this cl relays
towards the application id as present in SSH_AUTH_SOCK environment variable.

BUG=chromium:211948
TEST=manual
Change-Id: I6ebe361ad696aa1a59ee89ee018aca81c6b0fe5b
Reviewed-on: https://chromium-review.googlesource.com/195575
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>