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

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

Issue 2348913002: Port storage manager to MD settings. (Closed)
Patch Set: Address review comments 2. Created 4 years, 2 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 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 /** 5 /**
6 * @fileoverview 'settings-device-page' is the settings page for device and 6 * @fileoverview 'settings-device-page' is the settings page for device and
7 * peripheral settings. 7 * peripheral settings.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-device-page', 10 is: 'settings-device-page',
(...skipping 24 matching lines...) Expand all
35 }, 35 },
36 36
37 /** @private */ 37 /** @private */
38 stylusAllowed_: { 38 stylusAllowed_: {
39 type: Boolean, 39 type: Boolean,
40 value: function() { 40 value: function() {
41 return loadTimeData.getBoolean('stylusAllowed'); 41 return loadTimeData.getBoolean('stylusAllowed');
42 }, 42 },
43 readOnly: true, 43 readOnly: true,
44 }, 44 },
45
46 /** @private */
47 showStorageManager_: {
48 type: Boolean,
49 value: function() {
50 return loadTimeData.getBoolean('showStorageManager');
51 },
52 readOnly: true,
53 },
45 }, 54 },
46 55
47 observers: [ 56 observers: [
48 'pointersChanged_(hasMouse_, hasTouchpad_)', 57 'pointersChanged_(hasMouse_, hasTouchpad_)',
49 ], 58 ],
50 59
51 ready: function() { 60 ready: function() {
52 cr.addWebUIListener('has-mouse-changed', this.set.bind(this, 'hasMouse_')); 61 cr.addWebUIListener('has-mouse-changed', this.set.bind(this, 'hasMouse_'));
53 cr.addWebUIListener( 62 cr.addWebUIListener(
54 'has-touchpad-changed', this.set.bind(this, 'hasTouchpad_')); 63 'has-touchpad-changed', this.set.bind(this, 'hasTouchpad_'));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 }, 115 },
107 116
108 /** 117 /**
109 * Handler for tapping the Display settings menu item. 118 * Handler for tapping the Display settings menu item.
110 * @private 119 * @private
111 */ 120 */
112 onDisplayTap_: function() { 121 onDisplayTap_: function() {
113 settings.navigateTo(settings.Route.DISPLAY); 122 settings.navigateTo(settings.Route.DISPLAY);
114 }, 123 },
115 124
125 /**
126 * Handler for tapping the Storage settings menu item.
127 * @private
128 */
129 onStorageTap_: function() {
130 settings.navigateTo(settings.Route.STORAGE);
131 },
132
116 /** @protected */ 133 /** @protected */
117 currentRouteChanged: function() { 134 currentRouteChanged: function() {
118 this.checkPointerSubpage_(); 135 this.checkPointerSubpage_();
119 }, 136 },
120 137
121 /** 138 /**
122 * @param {boolean} hasMouse 139 * @param {boolean} hasMouse
123 * @param {boolean} hasTouchpad 140 * @param {boolean} hasTouchpad
124 * @private 141 * @private
125 */ 142 */
126 pointersChanged_: function(hasMouse, hasTouchpad) { 143 pointersChanged_: function(hasMouse, hasTouchpad) {
127 this.$.pointersRow.hidden = !hasMouse && !hasTouchpad; 144 this.$.pointersRow.hidden = !hasMouse && !hasTouchpad;
128 this.checkPointerSubpage_(); 145 this.checkPointerSubpage_();
129 }, 146 },
130 147
131 /** 148 /**
132 * Leaves the pointer subpage if all pointing devices are detached. 149 * Leaves the pointer subpage if all pointing devices are detached.
133 * @private 150 * @private
134 */ 151 */
135 checkPointerSubpage_: function() { 152 checkPointerSubpage_: function() {
136 if (!this.hasMouse_ && !this.hasTouchpad_ && 153 if (!this.hasMouse_ && !this.hasTouchpad_ &&
137 settings.getCurrentRoute() == settings.Route.POINTERS) { 154 settings.getCurrentRoute() == settings.Route.POINTERS) {
138 settings.navigateTo(settings.Route.DEVICE); 155 settings.navigateTo(settings.Route.DEVICE);
139 } 156 }
140 }, 157 },
141 }); 158 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698