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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js

Issue 2604883002: DevTools: namespace globals (Closed)
Patch Set: address CL feedback Created 3 years, 11 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 * @unrestricted 891 * @unrestricted
892 */ 892 */
893 UI.ToolbarCheckbox = class extends UI.ToolbarItem { 893 UI.ToolbarCheckbox = class extends UI.ToolbarItem {
894 /** 894 /**
895 * @param {string} text 895 * @param {string} text
896 * @param {string=} title 896 * @param {string=} title
897 * @param {!Common.Setting=} setting 897 * @param {!Common.Setting=} setting
898 * @param {function()=} listener 898 * @param {function()=} listener
899 */ 899 */
900 constructor(text, title, setting, listener) { 900 constructor(text, title, setting, listener) {
901 super(createCheckboxLabel(text)); 901 super(UI.createCheckboxLabel(text));
902 this.element.classList.add('checkbox'); 902 this.element.classList.add('checkbox');
903 this.inputElement = this.element.checkboxElement; 903 this.inputElement = this.element.checkboxElement;
904 if (title) 904 if (title)
905 this.element.title = title; 905 this.element.title = title;
906 if (setting) 906 if (setting)
907 UI.SettingsUI.bindCheckbox(this.inputElement, setting); 907 UI.SettingsUI.bindCheckbox(this.inputElement, setting);
908 if (listener) 908 if (listener)
909 this.inputElement.addEventListener('click', listener, false); 909 this.inputElement.addEventListener('click', listener, false);
910 } 910 }
911 911
912 /** 912 /**
913 * @return {boolean} 913 * @return {boolean}
914 */ 914 */
915 checked() { 915 checked() {
916 return this.inputElement.checked; 916 return this.inputElement.checked;
917 } 917 }
918 918
919 /** 919 /**
920 * @param {boolean} value 920 * @param {boolean} value
921 */ 921 */
922 setChecked(value) { 922 setChecked(value) {
923 this.inputElement.checked = value; 923 this.inputElement.checked = value;
924 } 924 }
925 }; 925 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698