Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / extensions / extensions.js
index e678099..ca186f2 100644 (file)
@@ -5,16 +5,30 @@
 <include src="../uber/uber_utils.js">
 <include src="extension_code.js">
 <include src="extension_commands_overlay.js">
+<include src="extension_error_overlay.js">
 <include src="extension_focus_manager.js">
 <include src="extension_list.js">
 <include src="pack_extension_overlay.js">
-<include src="extension_error_overlay.js">
 <include src="extension_loader.js">
+<include src="extension_options_overlay.js">
 
 <if expr="chromeos">
 <include src="chromeos/kiosk_apps.js">
 </if>
 
+/**
+ * The type of the extension data object. The definition is based on
+ * chrome/browser/ui/webui/extensions/extension_settings_handler.cc:
+ *     ExtensionSettingsHandler::HandleRequestExtensionsData()
+ * @typedef {{developerMode: boolean,
+ *            extensions: Array,
+ *            incognitoAvailable: boolean,
+ *            loadUnpackedDisabled: boolean,
+ *            profileIsSupervised: boolean,
+ *            promoteAppsDevTools: boolean}}
+ */
+var ExtensionDataResponse;
+
 // Used for observing function of the backend datasource for this page by
 // tests.
 var webuiResponded = false;
@@ -153,6 +167,9 @@ cr.define('extensions', function() {
       extensions.ExtensionErrorOverlay.getInstance().initializePage(
           extensions.ExtensionSettings.showOverlay);
 
+      extensions.ExtensionOptionsOverlay.getInstance().initializePage(
+          extensions.ExtensionSettings.showOverlay);
+
       // Initialize the kiosk overlay.
       if (cr.isChromeOS) {
         var kioskOverlay = extensions.KioskAppsOverlay.getInstance();
@@ -255,7 +272,7 @@ cr.define('extensions', function() {
       } else {
         $('extension-settings').classList.remove('dev-mode');
       }
-      window.setTimeout(this.updatePromoVisibility_.bind(this));
+      window.setTimeout(this.updatePromoVisibility_.bind(this), 0);
 
       chrome.send('extensionSettingsToggleDeveloperMode');
     },
@@ -276,6 +293,7 @@ cr.define('extensions', function() {
   /**
    * Called by the dom_ui_ to re-populate the page with data representing
    * the current state of installed extensions.
+   * @param {ExtensionDataResponse} extensionsData
    */
   ExtensionSettings.returnExtensionsData = function(extensionsData) {
     // We can get called many times in short order, thus we need to
@@ -399,7 +417,7 @@ cr.define('extensions', function() {
       pages[i].setAttribute('aria-hidden', node ? 'true' : 'false');
     }
 
-    overlay.hidden = !node;
+    $('overlay').hidden = !node;
     uber.invokeMethodOnParent(node ? 'beginInterceptingEvents' :
                                      'stopInterceptingEvents');
   };
@@ -414,12 +432,15 @@ cr.define('extensions', function() {
     var measuringDiv = $('font-measuring-div');
     measuringDiv.textContent =
         loadTimeData.getString('extensionSettingsEnabled');
+    measuringDiv.className = 'enabled-text';
     var pxWidth = measuringDiv.clientWidth + trashWidth;
     measuringDiv.textContent =
         loadTimeData.getString('extensionSettingsEnable');
+    measuringDiv.className = 'enable-text';
     pxWidth = Math.max(measuringDiv.clientWidth + trashWidth, pxWidth);
     measuringDiv.textContent =
         loadTimeData.getString('extensionSettingsDeveloperMode');
+    measuringDiv.className = '';
     pxWidth = Math.max(measuringDiv.clientWidth, pxWidth);
 
     var style = document.createElement('style');