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

Side by Side Diff: chrome/browser/resources/md_history/app.js

Issue 2450663003: MD History: hide tooltip promo when drawer is swiped open (Closed)
Patch Set: settings title fix Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('md_history', function() { 5 cr.define('md_history', function() {
6 var lazyLoadPromise = null; 6 var lazyLoadPromise = null;
7 function ensureLazyLoaded() { 7 function ensureLazyLoaded() {
8 if (!lazyLoadPromise) { 8 if (!lazyLoadPromise) {
9 lazyLoadPromise = new Promise(function(resolve, reject) { 9 lazyLoadPromise = new Promise(function(resolve, reject) {
10 Polymer.Base.importHref( 10 Polymer.Base.importHref(
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 type: Boolean, 79 type: Boolean,
80 // Updated on synced-device-manager attach by chrome.sending 80 // Updated on synced-device-manager attach by chrome.sending
81 // 'otherDevicesInitialized'. 81 // 'otherDevicesInitialized'.
82 value: loadTimeData.getBoolean('isUserSignedIn'), 82 value: loadTimeData.getBoolean('isUserSignedIn'),
83 }, 83 },
84 84
85 toolbarShadow_: { 85 toolbarShadow_: {
86 type: Boolean, 86 type: Boolean,
87 reflectToAttribute: true, 87 reflectToAttribute: true,
88 notify: true, 88 notify: true,
89 } 89 },
90
91 showMenuPromo_: {
92 type: Boolean,
93 value: function() {
94 return loadTimeData.getBoolean('showMenuPromo');
95 },
96 notify: true,
calamity 2016/10/27 02:12:41 Does this need notify: true?
97 observer: 'showMenuPromoChanged_',
98 },
90 }, 99 },
91 100
92 // TODO(calamity): Replace these event listeners with data bound properties. 101 // TODO(calamity): Replace these event listeners with data bound properties.
93 listeners: { 102 listeners: {
94 'cr-menu-tap': 'onMenuTap_', 103 'cr-menu-tap': 'onMenuTap_',
95 'history-checkbox-select': 'checkboxSelected', 104 'history-checkbox-select': 'checkboxSelected',
96 'unselect-all': 'unselectAll', 105 'unselect-all': 'unselectAll',
97 'delete-selected': 'deleteSelected', 106 'delete-selected': 'deleteSelected',
98 'history-close-drawer': 'closeDrawer_', 107 'history-close-drawer': 'closeDrawer_',
99 'history-view-changed': 'historyViewChanged_', 108 'history-view-changed': 'historyViewChanged_',
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 }, 149 },
141 150
142 /** @private */ 151 /** @private */
143 onMenuTap_: function() { 152 onMenuTap_: function() {
144 var drawer = this.$$('#drawer'); 153 var drawer = this.$$('#drawer');
145 if (drawer) 154 if (drawer)
146 drawer.toggle(); 155 drawer.toggle();
147 }, 156 },
148 157
149 /** 158 /**
159 * @param {!CustomEvent} e
160 * @private
161 */
162 onOpenedChanged_: function(e) {
163 if (e.detail.value)
164 this.showMenuPromo_ = false;
165 },
166
167 /**
168 * @param {boolean} showMenuPromo
169 * @param {boolean|undefined} oldShowMenuPromo
170 * @private
171 */
172 showMenuPromoChanged_: function(showMenuPromo, oldShowMenuPromo) {
173 if (!showMenuPromo && oldShowMenuPromo)
174 md_history.BrowserService.getInstance().menuPromoShown();
175 },
176
177 /**
150 * Listens for history-item being selected or deselected (through checkbox) 178 * Listens for history-item being selected or deselected (through checkbox)
151 * and changes the view of the top toolbar. 179 * and changes the view of the top toolbar.
152 * @param {{detail: {countAddition: number}}} e 180 * @param {{detail: {countAddition: number}}} e
153 */ 181 */
154 checkboxSelected: function(e) { 182 checkboxSelected: function(e) {
155 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); 183 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar);
156 toolbar.count = /** @type {HistoryListContainerElement} */ (this.$.history) 184 toolbar.count = /** @type {HistoryListContainerElement} */ (this.$.history)
157 .getSelectedItemCount(); 185 .getSelectedItemCount();
158 }, 186 },
159 187
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 break; 378 break;
351 } 379 }
352 break; 380 break;
353 } 381 }
354 382
355 md_history.BrowserService.getInstance().recordHistogram( 383 md_history.BrowserService.getInstance().recordHistogram(
356 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END 384 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END
357 ); 385 );
358 }, 386 },
359 }); 387 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698