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

Side by Side Diff: chrome/browser/resources/options2/clear_browser_data_overlay.js

Issue 10502015: Adding "Clear hosted app data" checkbox to browsing data removal UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing? Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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('options', function() { 5 cr.define('options', function() {
6 var OptionsPage = options.OptionsPage; 6 var OptionsPage = options.OptionsPage;
7 7
8 /** 8 /**
9 * ClearBrowserDataOverlay class 9 * ClearBrowserDataOverlay class
10 * Encapsulated handling of the 'Clear Browser Data' overlay page. 10 * Encapsulated handling of the 'Clear Browser Data' overlay page.
(...skipping 18 matching lines...) Expand all
29 // Call base class implementation to starts preference initialization. 29 // Call base class implementation to starts preference initialization.
30 OptionsPage.prototype.initializePage.call(this); 30 OptionsPage.prototype.initializePage.call(this);
31 31
32 var f = this.updateCommitButtonState_.bind(this); 32 var f = this.updateCommitButtonState_.bind(this);
33 var types = ['browser.clear_data.browsing_history', 33 var types = ['browser.clear_data.browsing_history',
34 'browser.clear_data.download_history', 34 'browser.clear_data.download_history',
35 'browser.clear_data.cache', 35 'browser.clear_data.cache',
36 'browser.clear_data.cookies', 36 'browser.clear_data.cookies',
37 'browser.clear_data.passwords', 37 'browser.clear_data.passwords',
38 'browser.clear_data.form_data', 38 'browser.clear_data.form_data',
39 'browser.clear_data.hosted_apps_data',
39 'browser.clear_data.content_licenses']; 40 'browser.clear_data.content_licenses'];
40 types.forEach(function(type) { 41 types.forEach(function(type) {
41 Preferences.getInstance().addEventListener(type, f); 42 Preferences.getInstance().addEventListener(type, f);
42 }); 43 });
43 44
44 var checkboxes = document.querySelectorAll( 45 var checkboxes = document.querySelectorAll(
45 '#cbdContentArea input[type=checkbox]'); 46 '#cbdContentArea input[type=checkbox]');
46 for (var i = 0; i < checkboxes.length; i++) { 47 for (var i = 0; i < checkboxes.length; i++) {
47 checkboxes[i].onclick = f; 48 checkboxes[i].onclick = f;
48 } 49 }
(...skipping 25 matching lines...) Expand all
74 // 75 //
75 // Chrome callbacks 76 // Chrome callbacks
76 // 77 //
77 ClearBrowserDataOverlay.setClearingState = function(state) { 78 ClearBrowserDataOverlay.setClearingState = function(state) {
78 $('deleteBrowsingHistoryCheckbox').disabled = state; 79 $('deleteBrowsingHistoryCheckbox').disabled = state;
79 $('deleteDownloadHistoryCheckbox').disabled = state; 80 $('deleteDownloadHistoryCheckbox').disabled = state;
80 $('deleteCacheCheckbox').disabled = state; 81 $('deleteCacheCheckbox').disabled = state;
81 $('deleteCookiesCheckbox').disabled = state; 82 $('deleteCookiesCheckbox').disabled = state;
82 $('deletePasswordsCheckbox').disabled = state; 83 $('deletePasswordsCheckbox').disabled = state;
83 $('deleteFormDataCheckbox').disabled = state; 84 $('deleteFormDataCheckbox').disabled = state;
85 $('deleteHostedAppsDataCheckbox').disabled = state;
84 $('deauthorizeContentLicensesCheckbox').disabled = state; 86 $('deauthorizeContentLicensesCheckbox').disabled = state;
85 $('clearBrowserDataTimePeriod').disabled = state; 87 $('clearBrowserDataTimePeriod').disabled = state;
86 $('cbdThrobber').style.visibility = state ? 'visible' : 'hidden'; 88 $('cbdThrobber').style.visibility = state ? 'visible' : 'hidden';
87 89
88 if (state) 90 if (state)
89 $('clearBrowserDataCommit').disabled = true; 91 $('clearBrowserDataCommit').disabled = true;
90 else 92 else
91 ClearBrowserDataOverlay.getInstance().updateCommitButtonState_(); 93 ClearBrowserDataOverlay.getInstance().updateCommitButtonState_();
92 }; 94 };
93 95
94 ClearBrowserDataOverlay.doneClearing = function() { 96 ClearBrowserDataOverlay.doneClearing = function() {
95 // The delay gives the user some feedback that the clearing 97 // The delay gives the user some feedback that the clearing
96 // actually worked. Otherwise the dialog just vanishes instantly in most 98 // actually worked. Otherwise the dialog just vanishes instantly in most
97 // cases. 99 // cases.
98 window.setTimeout(function() { 100 window.setTimeout(function() {
99 ClearBrowserDataOverlay.dismiss(); 101 ClearBrowserDataOverlay.dismiss();
100 }, 200); 102 }, 200);
101 }; 103 };
102 104
103 ClearBrowserDataOverlay.dismiss = function() { 105 ClearBrowserDataOverlay.dismiss = function() {
104 OptionsPage.closeOverlay(); 106 OptionsPage.closeOverlay();
105 this.setClearingState(false); 107 this.setClearingState(false);
106 }; 108 };
107 109
108 // Export 110 // Export
109 return { 111 return {
110 ClearBrowserDataOverlay: ClearBrowserDataOverlay 112 ClearBrowserDataOverlay: ClearBrowserDataOverlay
111 }; 113 };
112 }); 114 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698