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

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

Issue 424833008: adds restart message and link to crash reporting setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed ids from html elements Created 6 years, 4 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 OptionsPage = options.OptionsPage; 6 var OptionsPage = options.OptionsPage;
7 var Page = cr.ui.pageManager.Page; 7 var Page = cr.ui.pageManager.Page;
8 var PageManager = cr.ui.pageManager.PageManager; 8 var PageManager = cr.ui.pageManager.PageManager;
9 var ArrayDataModel = cr.ui.ArrayDataModel; 9 var ArrayDataModel = cr.ui.ArrayDataModel;
10 var RepeatingButton = cr.ui.RepeatingButton; 10 var RepeatingButton = cr.ui.RepeatingButton;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 $('privacyClearDataButton').hidden = OptionsPage.isSettingsApp(); 343 $('privacyClearDataButton').hidden = OptionsPage.isSettingsApp();
344 // 'metricsReportingEnabled' element is only present on Chrome branded 344 // 'metricsReportingEnabled' element is only present on Chrome branded
345 // builds, and the 'metricsReportingCheckboxAction' message is only 345 // builds, and the 'metricsReportingCheckboxAction' message is only
346 // handled on ChromeOS. 346 // handled on ChromeOS.
347 if ($('metricsReportingEnabled') && cr.isChromeOS) { 347 if ($('metricsReportingEnabled') && cr.isChromeOS) {
348 $('metricsReportingEnabled').onclick = function(event) { 348 $('metricsReportingEnabled').onclick = function(event) {
349 chrome.send('metricsReportingCheckboxAction', 349 chrome.send('metricsReportingCheckboxAction',
350 [String(event.currentTarget.checked)]); 350 [String(event.currentTarget.checked)]);
351 }; 351 };
352 } 352 }
353 if ($('metricsReportingEnabled') && !cr.isChromeOS) {
354 // The localized string has the | symbol on each side of the text that
355 // needs to be made into a button to restart Chrome. We parse the text
356 // and build the button from that.
357 var restartTextFragments =
358 loadTimeData.getString('metricsReportingResetRestart').split('|');
359 // Assume structure is something like "starting text |link text| ending
360 // text" where both starting text and ending text may or may not be
361 // present, but the split should always be in three pieces.
362 var restartElements =
363 $('metrics-reporting-reset-restart').querySelectorAll('*');
364 for (var i = 0; i < restartTextFragments.length; i++) {
365 restartElements[i].textContent = restartTextFragments[i];
366 }
367 restartElements[1].onclick = function(event) {
368 chrome.send('restartBrowser');
369 };
370 /*
Sigurður Ásgeirsson 2014/08/01 09:04:58 is this comment block intentional?
luken 2014/08/01 15:45:47 Whoops, nope, accidentally left that in. Removed.
371 $('metrics-reporting-reset-restart-starting-text').textContent =
372 restartTextFragments[0];
373 $('metrics-reporting-reset-restart-button').textContent =
374 restartTextFragments[1];
375 $('metrics-reporting-reset-restart-button').onclick = function(event) {
376 chrome.send('restartBrowser');
377 };
378 $('metrics-reporting-reset-restart-ending-text').textContent =
379 restartTextFragments[2];
380 */
381 var updateMetricsRestartButton = function() {
382 $('metrics-reporting-reset-restart').hidden =
383 loadTimeData.getBoolean('metricsReportingEnabledAtStart') ==
384 $('metricsReportingEnabled').checked;
385 };
386 Preferences.getInstance().addEventListener(
387 $('metricsReportingEnabled').getAttribute('pref'),
388 updateMetricsRestartButton);
389 updateMetricsRestartButton();
390 }
353 391
354 // Bluetooth (CrOS only). 392 // Bluetooth (CrOS only).
355 if (cr.isChromeOS) { 393 if (cr.isChromeOS) {
356 options.system.bluetooth.BluetoothDeviceList.decorate( 394 options.system.bluetooth.BluetoothDeviceList.decorate(
357 $('bluetooth-paired-devices-list')); 395 $('bluetooth-paired-devices-list'));
358 396
359 $('bluetooth-add-device').onclick = 397 $('bluetooth-add-device').onclick =
360 this.handleAddBluetoothDevice_.bind(this); 398 this.handleAddBluetoothDevice_.bind(this);
361 399
362 $('enable-bluetooth').onchange = function(event) { 400 $('enable-bluetooth').onchange = function(event) {
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 BrowserOptions.getLoggedInUsername = function() { 1921 BrowserOptions.getLoggedInUsername = function() {
1884 return BrowserOptions.getInstance().username_; 1922 return BrowserOptions.getInstance().username_;
1885 }; 1923 };
1886 } 1924 }
1887 1925
1888 // Export 1926 // Export
1889 return { 1927 return {
1890 BrowserOptions: BrowserOptions 1928 BrowserOptions: BrowserOptions
1891 }; 1929 };
1892 }); 1930 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/browser_options.html ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698