Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / options / content_settings_exceptions_area.js
index 31c6a5e..b1b14a1 100644 (file)
@@ -104,8 +104,10 @@ cr.define('options.contentSettings', function() {
         this.editable = false;
       }
 
-      this.addEditField(select, this.settingLabel);
-      this.contentElement.appendChild(select);
+      if (this.contentType != 'zoomlevels') {
+        this.addEditField(select, this.settingLabel);
+        this.contentElement.appendChild(select);
+      }
       select.className = 'exception-setting';
       select.setAttribute('aria-labelledby', 'exception-behavior-column');
 
@@ -123,6 +125,19 @@ cr.define('options.contentSettings', function() {
         this.contentElement.appendChild(videoSettingLabel);
       }
 
+      if (this.contentType == 'zoomlevels') {
+        this.deletable = true;
+        this.editable = false;
+
+        var zoomLabel = cr.doc.createElement('span');
+        zoomLabel.textContent = this.dataItem.zoom;
+        zoomLabel.className = 'exception-setting';
+        zoomLabel.setAttribute('displaymode', 'static');
+        zoomLabel.setAttribute('aria-labelledby', 'exception-zoom-column');
+        this.contentElement.appendChild(zoomLabel);
+        this.zoomLabel = zoomLabel;
+      }
+
       // Used to track whether the URL pattern in the input is valid.
       // This will be true if the browser process has informed us that the
       // current text in the input is valid. Changing the text resets this to
@@ -541,7 +556,8 @@ cr.define('options.contentSettings', function() {
       return !(this.contentType == 'notifications' ||
                this.contentType == 'location' ||
                this.contentType == 'fullscreen' ||
-               this.contentType == 'media-stream');
+               this.contentType == 'media-stream' ||
+               this.contentType == 'zoomlevels');
     },
 
     /**
@@ -573,7 +589,8 @@ cr.define('options.contentSettings', function() {
     },
   };
 
-  var OptionsPage = options.OptionsPage;
+  var Page = cr.ui.pageManager.Page;
+  var PageManager = cr.ui.pageManager.PageManager;
 
   /**
    * Encapsulated handling of content settings list subpage.
@@ -581,18 +598,19 @@ cr.define('options.contentSettings', function() {
    * @constructor
    */
   function ContentSettingsExceptionsArea() {
-    OptionsPage.call(this, 'contentExceptions',
-                     loadTimeData.getString('contentSettingsPageTabTitle'),
-                     'content-settings-exceptions-area');
+    Page.call(this, 'contentExceptions',
+              loadTimeData.getString('contentSettingsPageTabTitle'),
+              'content-settings-exceptions-area');
   }
 
   cr.addSingletonGetter(ContentSettingsExceptionsArea);
 
   ContentSettingsExceptionsArea.prototype = {
-    __proto__: OptionsPage.prototype,
+    __proto__: Page.prototype,
 
+    /** @override */
     initializePage: function() {
-      OptionsPage.prototype.initializePage.call(this);
+      Page.prototype.initializePage.call(this);
 
       var exceptionsLists = this.pageDiv.querySelectorAll('list');
       for (var i = 0; i < exceptionsLists.length; i++) {
@@ -605,7 +623,7 @@ cr.define('options.contentSettings', function() {
       this.showList('cookies');
 
       $('content-settings-exceptions-overlay-confirm').onclick =
-          OptionsPage.closeOverlay.bind(OptionsPage);
+          PageManager.closeOverlay.bind(PageManager);
     },
 
     /**
@@ -614,6 +632,9 @@ cr.define('options.contentSettings', function() {
      * @param {string} type The content type.
      */
     showList: function(type) {
+      // Update the title for the type that was shown.
+      this.title = loadTimeData.getString(type + 'TabTitle');
+
       var header = this.pageDiv.querySelector('h1');
       header.textContent = loadTimeData.getString(type + '_header');
 
@@ -627,6 +648,9 @@ cr.define('options.contentSettings', function() {
 
       var mediaHeader = this.pageDiv.querySelector('.media-header');
       mediaHeader.hidden = type != 'media-stream';
+
+      $('exception-behavior-column').hidden = type == 'zoomlevels';
+      $('exception-zoom-column').hidden = type != 'zoomlevels';
     },
 
     /**