<?xml version="1.0" encoding='UTF-8'?>

<!DOCTYPE window SYSTEM "chrome://cmsafeflag/locale/safeflag.dtd">
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://cmsafeflag/skin/overlay.css" type="text/css"?>

<overlay id="safeflag" xmlns:html="http://www.w3.org/1999/xhtml"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script src="chrome://cmsafeflag/content/utils.js"></script>
  <script src="chrome://cmsafeflag/content/safeflag.js"></script>
  <script src="chrome://cmsafeflag/content/flaglayout.js"></script>
  <script type="application/javascript">
    function openSafeFlagOptions(){
      var features = "chrome,titlebar,toolbar,centerscreen";
      try {
        var instantApply = Components.classes["@mozilla.org/preferences-service;1"]
                             .getService(Components.interfaces.nsIPrefService)
                             .getBranch("browser.preferences.").getBoolPref("instantApply");
        features += instantApply ? ",dialog=no" : ",modal";
      } catch (e) {
        features += ",modal";
      }
      window.openDialog("chrome://cmsafeflag/content/options.xul", "cpmanagerOptions", features, "safeflagpane").focus();
    }
  </script>
  <stringbundleset id="stringbundleset">
    <stringbundle id="safeflag-strings" src="chrome://cmsafeflag/locale/safeflag.properties"/>
  </stringbundleset>

  <hbox id="urlbar-icons">
    <image id="safeflag-icon" class="urlbar-icon" hidden="true" insertbefore="star-button"
           src="chrome://cmsafeflag/content/icons/special/default.png" context="safeflag-contextpopup"/>
  </hbox>

  <popupset id="mainPopupSet">
    <popup id="safeflag-contextpopup">
      <menuitem label="&prefs.options;" oncommand="openSafeFlagOptions();"/>
    </popup>
    <panel id="safeflag-popup">
      <vbox id="safeflag-popup-safe">
        <hbox>
          <vbox>
            <image src="chrome://cmsafeflag/skin/info-safe.png"></image>
          </vbox>
          <vbox>
            <label class="safeflag-result" value="&safeflag.safeJudgedByGoogle;" />
            <html:p class="safeflag-description">&safeflag.safeDescription;</html:p>
          </vbox>
        </hbox>
        <hbox>
          <spacer flex="1"></spacer>
          <label value="&safeflag.keepYourBrowserSafe;" />
        </hbox>
      </vbox>
      <vbox id="safeflag-popup-risk">
        <hbox>
          <vbox>
            <image src="chrome://cmsafeflag/skin/info-risk.png"></image>
          </vbox>
          <vbox>
            <label class="safeflag-result" value="&safeflag.unSafeJudgedByGoogle;" />
            <html:p class="safeflag-description">&safeflag.unSafeDescription;</html:p>
          </vbox>
        </hbox>
        <hbox>
          <spacer flex="1"></spacer>
          <label value="&safeflag.keepYourBrowserSafe;" />
        </hbox>
      </vbox>
    </panel>
  </popupset>
</overlay>
