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

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: tweaks 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 observer: 'showMenuPromoChanged_',
97 },
90 }, 98 },
91 99
92 // TODO(calamity): Replace these event listeners with data bound properties. 100 // TODO(calamity): Replace these event listeners with data bound properties.
93 listeners: { 101 listeners: {
94 'cr-menu-tap': 'onMenuTap_', 102 'cr-menu-tap': 'onMenuTap_',
95 'history-checkbox-select': 'checkboxSelected', 103 'history-checkbox-select': 'checkboxSelected',
96 'unselect-all': 'unselectAll', 104 'unselect-all': 'unselectAll',
97 'delete-selected': 'deleteSelected', 105 'delete-selected': 'deleteSelected',
98 'history-close-drawer': 'closeDrawer_', 106 'history-close-drawer': 'closeDrawer_',
99 'history-view-changed': 'historyViewChanged_', 107 'history-view-changed': 'historyViewChanged_',
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 }, 148 },
141 149
142 /** @private */ 150 /** @private */
143 onMenuTap_: function() { 151 onMenuTap_: function() {
144 var drawer = this.$$('#drawer'); 152 var drawer = this.$$('#drawer');
145 if (drawer) 153 if (drawer)
146 drawer.toggle(); 154 drawer.toggle();
147 }, 155 },
148 156
149 /** 157 /**
158 * @param {!CustomEvent} e
159 * @private
160 */
161 onOpenedChanged_: function(e) {
162 if (e.detail.value)
163 this.showMenuPromo_ = false;
164 },
165
166 /** @private */
167 onCrToolbarPromoClose_: function() {
168 this.showMenuPromo_ = false;
169 },
170
171 /**
172 * @param {boolean} showMenuPromo
173 * @param {boolean|undefined} oldShowMenuPromo
174 * @private
175 */
176 showMenuPromoChanged_: function(showMenuPromo, oldShowMenuPromo) {
177 if (!showMenuPromo && oldShowMenuPromo)
Dan Beam 2016/10/27 03:22:18 damn it, this code wasn't even necessary after all
178 md_history.BrowserService.getInstance().menuPromoShown();
179 },
180
181 /**
150 * Listens for history-item being selected or deselected (through checkbox) 182 * Listens for history-item being selected or deselected (through checkbox)
151 * and changes the view of the top toolbar. 183 * and changes the view of the top toolbar.
152 * @param {{detail: {countAddition: number}}} e 184 * @param {{detail: {countAddition: number}}} e
153 */ 185 */
154 checkboxSelected: function(e) { 186 checkboxSelected: function(e) {
155 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); 187 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar);
156 toolbar.count = /** @type {HistoryListContainerElement} */ (this.$.history) 188 toolbar.count = /** @type {HistoryListContainerElement} */ (this.$.history)
157 .getSelectedItemCount(); 189 .getSelectedItemCount();
158 }, 190 },
159 191
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 break; 382 break;
351 } 383 }
352 break; 384 break;
353 } 385 }
354 386
355 md_history.BrowserService.getInstance().recordHistogram( 387 md_history.BrowserService.getInstance().recordHistogram(
356 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END 388 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END
357 ); 389 );
358 }, 390 },
359 }); 391 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698