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

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

Issue 1418803004: MD Settings: Migrating C++ handlers for profile reset page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove usage of max-width to fix dialog positioning. Created 5 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 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-reset-page' is the settings page containing reset 7 * 'settings-reset-page' is the settings page containing reset
8 * settings. 8 * settings.
9 * 9 *
10 * Example: 10 * Example:
11 * 11 *
12 * <iron-animated-pages> 12 * <iron-animated-pages>
13 * <settings-reset-page prefs="{{prefs}}"> 13 * <settings-reset-page prefs="{{prefs}}">
14 * </settings-reset-page> 14 * </settings-reset-page>
15 * ... other pages ... 15 * ... other pages ...
16 * </iron-animated-pages> 16 * </iron-animated-pages>
17 * 17 *
18 * @group Chrome Settings Elements 18 * @group Chrome Settings Elements
19 * @element settings-reset-page 19 * @element settings-reset-page
20 */ 20 */
21 Polymer({ 21 Polymer({
22 is: 'settings-reset-page', 22 is: 'settings-reset-page',
23 23
24 properties: {
25 feedbackInfo: String,
26 },
27
28 attached: function() {
29 cr.define('SettingsResetPage', function() {
30 return {
31 doneResetting: function() {
32 this.$.resetSpinner.active = false;
33 this.$.resetDialog.close();
34 }.bind(this),
35
36 setFeedbackInfo: function(data) {
37 this.set('feedbackInfo', data.feedbackInfo);
38 }.bind(this),
39 };
40 }.bind(this));
41 },
42
24 /** @private */ 43 /** @private */
25 onShowDialog_: function() { 44 onShowDialog_: function() {
26 this.$.resetDialog.open(); 45 this.$.resetDialog.open();
46 chrome.send('onShowResetProfileDialog');
27 }, 47 },
28 48
29 /** @private */ 49 /** @private */
30 onCancelTap_: function() { 50 onCancelTap_: function() {
31 this.$.resetDialog.close(); 51 this.$.resetDialog.close();
52 chrome.send('onHideResetProfileDialog');
32 }, 53 },
33 54
34 /** @private */ 55 /** @private */
35 onResetTap_: function() { 56 onResetTap_: function() {
36 // TODO(dpapad): Set up C++ handlers and figure out when it is OK to close 57 this.$.resetSpinner.active = true;
37 // the dialog. 58 chrome.send('performResetProfileSettings', [this.$.sendSettings.checked]);
38 this.$.resetDialog.close();
39 }, 59 },
40 60
41 /** @private */ 61 /** @private */
42 onLearnMoreTap_: function() { 62 onLearnMoreTap_: function() {
43 window.open(loadTimeData.getString('resetPageLearnMoreUrl')); 63 window.open(loadTimeData.getString('resetPageLearnMoreUrl'));
64 },
65
66 /** @private */
67 onCheckboxChange_: function() {
68 this.$.sendSettings.checked ?
69 this.$.settings.removeAttribute('hidden') :
70 this.$.settings.setAttribute('hidden', true);
Dan Beam 2015/11/07 00:07:06 this.$.settings.hidden = !this.$.sendSettings.chec
dpapad 2015/11/07 00:31:08 Done.
44 } 71 }
45 }); 72 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698