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

Side by Side Diff: chrome/browser/resources/settings/downloads_page/downloads_page.js

Issue 2861443003: MD Settings: Fix subpage visibility and add appearance page tests (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-downloads-page' is the settings page containing downloads 7 * 'settings-downloads-page' is the settings page containing downloads
8 * settings. 8 * settings.
9 * 9 *
10 * Example: 10 * Example:
(...skipping 15 matching lines...) Expand all
26 */ 26 */
27 prefs: { 27 prefs: {
28 type: Object, 28 type: Object,
29 notify: true, 29 notify: true,
30 }, 30 },
31 31
32 /** 32 /**
33 * Dictionary defining page visibility. 33 * Dictionary defining page visibility.
34 * @type {!DownloadsPageVisibility} 34 * @type {!DownloadsPageVisibility}
35 */ 35 */
36 pageVisibility: Object, 36 pageVisibility: {
37 type: Object,
38 value: function() {
dpapad 2017/05/02 23:45:52 Can we follow the approach of the previous CL, whe
stevenjb 2017/05/02 23:56:17 So, if we don't do this, we need to ensure that an
dpapad 2017/05/03 00:18:48 Hm, I think it actually made me realize that I sho
stevenjb 2017/05/03 19:58:40 Ah, yes, you are correct, that's wrong, and fixing
39 return {};
40 },
41 },
37 42
38 /** @private */ 43 /** @private */
39 autoOpenDownloads_: { 44 autoOpenDownloads_: {
40 type: Boolean, 45 type: Boolean,
41 value: false, 46 value: false,
42 }, 47 },
43 }, 48 },
44 49
45 /** @private {?settings.DownloadsBrowserProxy} */ 50 /** @private {?settings.DownloadsBrowserProxy} */
46 browserProxy_: null, 51 browserProxy_: null,
47 52
48 /** @override */ 53 /** @override */
49 attached: function() { 54 attached: function() {
50 this.browserProxy_ = settings.DownloadsBrowserProxyImpl.getInstance(); 55 this.browserProxy_ = settings.DownloadsBrowserProxyImpl.getInstance();
51 56
52 this.addWebUIListener('auto-open-downloads-changed', function(autoOpen) { 57 this.addWebUIListener('auto-open-downloads-changed', function(autoOpen) {
53 this.autoOpenDownloads_ = autoOpen; 58 this.autoOpenDownloads_ = autoOpen;
54 }.bind(this)); 59 }.bind(this));
55 60
56 this.browserProxy_.initializeDownloads(); 61 this.browserProxy_.initializeDownloads();
57 }, 62 },
58 63
64 /**
65 * @param {boolean|undefined} visibility
66 * @return {boolean}
67 * @private
68 */
69 showPage_: function(visibility) {
70 return visibility !== false;
71 },
72
59 /** @private */ 73 /** @private */
60 selectDownloadLocation_: function() { 74 selectDownloadLocation_: function() {
61 listenOnce(this, 'transitionend', function() { 75 listenOnce(this, 'transitionend', function() {
62 this.browserProxy_.selectDownloadLocation(); 76 this.browserProxy_.selectDownloadLocation();
63 }.bind(this)); 77 }.bind(this));
64 }, 78 },
65 79
66 // <if expr="chromeos"> 80 // <if expr="chromeos">
67 /** 81 /**
68 * @param {string} path 82 * @param {string} path
(...skipping 11 matching lines...) Expand all
80 path = path.replace(/\//g, ' \u203a '); 94 path = path.replace(/\//g, ' \u203a ');
81 return path; 95 return path;
82 }, 96 },
83 // </if> 97 // </if>
84 98
85 /** @private */ 99 /** @private */
86 onClearAutoOpenFileTypesTap_: function() { 100 onClearAutoOpenFileTypesTap_: function() {
87 this.browserProxy_.resetAutoOpenFileTypes(); 101 this.browserProxy_.resetAutoOpenFileTypes();
88 }, 102 },
89 }); 103 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698