Home | History | Annotate | Download | only in options
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 cr.define('options', function() {
      6 
      7   //////////////////////////////////////////////////////////////////////////////
      8   // ContentSettingsRadio class:
      9 
     10   // Define a constructor that uses an input element as its underlying element.
     11   var ContentSettingsRadio = cr.ui.define('input');
     12 
     13   ContentSettingsRadio.prototype = {
     14     __proto__: HTMLInputElement.prototype,
     15 
     16     /**
     17      * Initialization function for the cr.ui framework.
     18      */
     19     decorate: function() {
     20       this.type = 'radio';
     21       var self = this;
     22 
     23       this.addEventListener('change',
     24           function(e) {
     25             chrome.send('setContentFilter', [this.name, this.value]);
     26           });
     27     },
     28   };
     29 
     30   // Export
     31   return {
     32     ContentSettingsRadio: ContentSettingsRadio
     33   };
     34 
     35 });
     36 
     37