Pressing "u" acts like a back button on change view page

Previously, pressing the "u'" button always took a user back to "/"
whether or not that was the page they were on before. Now, when
a user clicks "u" from the change view page, it will go back to the
last dashboard view or change list view the user was on. If they
did not come from one of those before ending up on a change
view, they will default to go back to "/" still.

Bug: Issue 4579
Change-Id: Ia143fc0da88af0009722831e22f6e8679989efb3
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
index 9f90800..560a5de 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
@@ -42,6 +42,7 @@
         notify: true,
         value: function() { return {}; },
       },
+      backPage: String,
       serverConfig: Object,
       keyEventTarget: {
         type: Object,
@@ -573,11 +574,17 @@
           break;
         case 85:  // 'u'
           e.preventDefault();
-          page.show('/');
+          this._determinePageBack();
           break;
       }
     },
 
+    _determinePageBack: function() {
+      // Default backPage to '/' if user came to change view page
+      // via an email link, etc.
+      page.show(this.backPage || '/');
+    },
+
     _labelsChanged: function(changeRecord) {
       if (!changeRecord) { return; }
       this.$.jsAPI.handleEvent(this.$.jsAPI.EventType.LABEL_CHANGE, {