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

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

Issue 1813023002: Add a notice about other forms of history to the CBD dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_component
Patch Set: Update strings. Created 4 years, 8 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 (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 Page = cr.ui.pageManager.Page; 6 var Page = cr.ui.pageManager.Page;
7 var PageManager = cr.ui.pageManager.PageManager; 7 var PageManager = cr.ui.pageManager.PageManager;
8 8
9 /** 9 /**
10 * ClearBrowserDataOverlay class 10 * ClearBrowserDataOverlay class
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 /** @override */ 93 /** @override */
94 didShowPage: function() { 94 didShowPage: function() {
95 chrome.send('openedClearBrowserData'); 95 chrome.send('openedClearBrowserData');
96 }, 96 },
97 97
98 /** 98 /**
99 * Create a footer that explains that some content is not cleared by the 99 * Create a footer that explains that some content is not cleared by the
100 * clear browsing data dialog and warns that the deletion may be synced. 100 * clear browsing data dialog and warns that the deletion may be synced.
101 * @param {boolean} simple Whether to use a simple support string. 101 * @param {boolean} simple Whether to use a simple support string.
102 * @param {boolean} syncing Whether the user uses Sync. 102 * @param {boolean} syncing Whether the user uses Sync.
103 * @param {boolean} showHistoryFooter Whether to show an additional footer
104 * about other forms of browsing history.
103 * @private 105 * @private
104 */ 106 */
105 createFooter_: function(simple, syncing) { 107 createFooter_: function(simple, syncing, showHistoryFooter) {
106 // The localized string is of the form "Saved [content settings] and 108 // The localized string is of the form "Saved [content settings] and
107 // {search engines} will not be cleared and may reflect your browsing 109 // {search engines} will not be cleared and may reflect your browsing
108 // habits.", or of the form "Some settings that may reflect browsing 110 // habits.", or of the form "Some settings that may reflect browsing
109 // habits |will not be cleared|." if the simplified support string 111 // habits |will not be cleared|." if the simplified support string
110 // experiment is enabled. The following parses out the parts in brackets 112 // experiment is enabled. The following parses out the parts in brackets
111 // and braces and converts them into buttons whereas the remainders are 113 // and braces and converts them into buttons whereas the remainders are
112 // represented as span elements. 114 // represented as span elements.
113 var footer = 115 var footer =
114 document.querySelector('#some-stuff-remains-footer p span'); 116 document.querySelector('#some-stuff-remains-footer p span');
115 var footerFragments = 117 var footerFragments =
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 }; 161 };
160 $('open-search-engines-from-clear-browsing-data').onclick = 162 $('open-search-engines-from-clear-browsing-data').onclick =
161 function(event) { 163 function(event) {
162 PageManager.showPageByName('searchEngines'); 164 PageManager.showPageByName('searchEngines');
163 }; 165 };
164 } 166 }
165 167
166 $('clear-browser-data-old-learn-more-link').hidden = simple; 168 $('clear-browser-data-old-learn-more-link').hidden = simple;
167 $('clear-browser-data-footer-learn-more-link').hidden = !simple; 169 $('clear-browser-data-footer-learn-more-link').hidden = !simple;
168 $('flash-storage-settings').hidden = simple; 170 $('flash-storage-settings').hidden = simple;
171 $('clear-browser-data-history-footer').hidden = !showHistoryFooter;
169 }, 172 },
170 173
171 /** 174 /**
172 * Shows or hides the sync warning based on whether the user uses Sync. 175 * Shows or hides the sync warning based on whether the user uses Sync.
173 * @param {boolean} syncing Whether the user uses Sync. 176 * @param {boolean} syncing Whether the user uses Sync.
177 * @param {boolean} showHistoryFooter Whether the user syncs history
178 * and conditions are met to show an additional history footer.
174 * @private 179 * @private
175 */ 180 */
176 updateSyncWarning_: function(syncing) { 181 updateSyncWarningAndHistoryFooter_: function(syncing, showHistoryFooter) {
177 $('clear-browser-data-sync-warning').hidden = !syncing; 182 $('clear-browser-data-sync-warning').hidden = !syncing;
183 $('clear-browser-data-history-footer').hidden = !showHistoryFooter;
178 }, 184 },
179 185
180 /** 186 /**
181 * Sets whether or not we are in the process of clearing data. 187 * Sets whether or not we are in the process of clearing data.
182 * @param {boolean} clearing Whether the browsing data is currently being 188 * @param {boolean} clearing Whether the browsing data is currently being
183 * cleared. 189 * cleared.
184 * @private 190 * @private
185 */ 191 */
186 setClearing_: function(clearing) { 192 setClearing_: function(clearing) {
187 this.isClearingInProgress_ = clearing; 193 this.isClearingInProgress_ = clearing;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // Chrome callbacks 282 // Chrome callbacks
277 // 283 //
278 ClearBrowserDataOverlay.setAllowDeletingHistory = function(allowed) { 284 ClearBrowserDataOverlay.setAllowDeletingHistory = function(allowed) {
279 ClearBrowserDataOverlay.getInstance().setAllowDeletingHistory_(allowed); 285 ClearBrowserDataOverlay.getInstance().setAllowDeletingHistory_(allowed);
280 }; 286 };
281 287
282 ClearBrowserDataOverlay.updateCounter = function(pref_name, text) { 288 ClearBrowserDataOverlay.updateCounter = function(pref_name, text) {
283 ClearBrowserDataOverlay.getInstance().updateCounter_(pref_name, text); 289 ClearBrowserDataOverlay.getInstance().updateCounter_(pref_name, text);
284 }; 290 };
285 291
286 ClearBrowserDataOverlay.createFooter = function(simple, syncing) { 292 ClearBrowserDataOverlay.createFooter = function(
287 ClearBrowserDataOverlay.getInstance().createFooter_(simple, syncing); 293 simple, syncing, showHistoryFooter) {
294 ClearBrowserDataOverlay.getInstance().createFooter_(
295 simple, syncing, showHistoryFooter);
288 }; 296 };
289 297
290 ClearBrowserDataOverlay.updateSyncWarning = function(syncing) { 298 ClearBrowserDataOverlay.updateSyncWarningAndHistoryFooter = function(
291 ClearBrowserDataOverlay.getInstance().updateSyncWarning_(syncing); 299 syncing, showHistoryFooter) {
300 ClearBrowserDataOverlay.getInstance().updateSyncWarningAndHistoryFooter_(
301 syncing, showHistoryFooter);
292 }; 302 };
293 303
294 ClearBrowserDataOverlay.setClearing = function(clearing) { 304 ClearBrowserDataOverlay.setClearing = function(clearing) {
295 ClearBrowserDataOverlay.getInstance().setClearing_(clearing); 305 ClearBrowserDataOverlay.getInstance().setClearing_(clearing);
296 }; 306 };
297 307
298 ClearBrowserDataOverlay.markInitializationComplete = function() { 308 ClearBrowserDataOverlay.markInitializationComplete = function() {
299 ClearBrowserDataOverlay.getInstance().markInitializationComplete_(); 309 ClearBrowserDataOverlay.getInstance().markInitializationComplete_();
300 }; 310 };
301 311
302 ClearBrowserDataOverlay.setBannerText = function(text) { 312 ClearBrowserDataOverlay.setBannerText = function(text) {
303 $('clear-browser-data-info-banner').innerText = text; 313 $('clear-browser-data-info-banner').innerText = text;
304 }; 314 };
305 315
306 ClearBrowserDataOverlay.doneClearing = function() { 316 ClearBrowserDataOverlay.doneClearing = function(showHistoryNotice) {
307 // The delay gives the user some feedback that the clearing 317 // The delay gives the user some feedback that the clearing
308 // actually worked. Otherwise the dialog just vanishes instantly in most 318 // actually worked. Otherwise the dialog just vanishes instantly in most
309 // cases. 319 // cases.
310 window.setTimeout(function() { 320 window.setTimeout(function() {
311 ClearBrowserDataOverlay.setClearing(false); 321 ClearBrowserDataOverlay.setClearing(false);
312 ClearBrowserDataOverlay.dismiss(); 322
323 if (showHistoryNotice)
324 PageManager.showPageByName('clearBrowserDataHistoryNotice');
325 else
326 ClearBrowserDataOverlay.dismiss();
313 }, 200); 327 }, 200);
314 }; 328 };
315 329
316 ClearBrowserDataOverlay.dismiss = function() { 330 ClearBrowserDataOverlay.dismiss = function() {
317 var topmostVisiblePage = PageManager.getTopmostVisiblePage(); 331 var topmostVisiblePage = PageManager.getTopmostVisiblePage();
318 if (topmostVisiblePage && topmostVisiblePage.name == 'clearBrowserData') 332 if (topmostVisiblePage && topmostVisiblePage.name == 'clearBrowserData')
319 PageManager.closeOverlay(); 333 PageManager.closeOverlay();
320 }; 334 };
321 335
322 // Export 336 // Export
323 return { 337 return {
324 ClearBrowserDataOverlay: ClearBrowserDataOverlay 338 ClearBrowserDataOverlay: ClearBrowserDataOverlay
325 }; 339 };
326 }); 340 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/clear_browser_data_overlay.html ('k') | chrome/browser/resources/options/googleg.svg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698