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

Unified Diff: chrome/browser/resources/md_history/side_bar.js

Issue 1607403004: MD History: Display synced tabs history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@second_patch
Patch Set: Style fixes & having no synced history will hide the sidebar Created 4 years, 11 months 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/browser/resources/md_history/side_bar.js
diff --git a/chrome/browser/resources/md_history/side_bar.js b/chrome/browser/resources/md_history/side_bar.js
new file mode 100644
index 0000000000000000000000000000000000000000..6f3ba9fc808b08443ce21a0f28243d7d46421de3
--- /dev/null
+++ b/chrome/browser/resources/md_history/side_bar.js
@@ -0,0 +1,50 @@
+// Copyright 2016 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.
+
+Polymer({
+ is: 'side-bar',
+
+ attached: function() {
+ this.showHistory();
+ },
+
+ properties: {
+ selectedDisplay: {
+ type: String,
+ value: 'history'
+ }
+ },
+
+ // TODO(yingran): possibly use polymer properties to change the styles of the
+ // menu. Also somehow simplify the below since there is repetition.
+ /**
+ * Fires event to display the synced tabs page.
+ */
+ showSyncedTabs: function() {
+ this.selectedPage = 'synced-tabs';
+ this.fire('switch-display', {
+ display: this.selectedPage
+ });
+
+ this.$['tab-button'].style.cursor = 'default';
+ this.$['synced-tabs'].style.color = '#47d';
+ this.$['history-button'].style.cursor = 'pointer';
+ this.$['history'].style.color = '#333';
+ },
+
+ /**
+ * Fires event to display the history item page.
+ */
+ showHistory: function() {
calamity 2016/02/02 04:09:47 Needing both of these is kinda lame. You should be
yingran 2016/02/09 04:21:34 Done.
+ this.selectedPage = 'history';
+ this.fire('switch-display', {
+ display: this.selectedPage
+ });
+
+ this.$['history-button'].style.cursor = 'default';
+ this.$['history'].style.color = '#47d';
+ this.$['tab-button'].style.cursor = 'pointer';
+ this.$['synced-tabs'].style.color = '#333';
calamity 2016/02/02 04:09:47 Use a CSS style that changes between these when an
yingran 2016/02/09 04:21:34 Done.
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698