<?xml version="1.0"?>


<!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
<!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd">
%brandDTD;
%syncBrandDTD;
%syncDTD;
]>

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

  <prefpane id="paneSync"
            helpTopic="prefs-weave"
            onpaneload="gSyncPane.init()">

    <preferences>
      <preference id="engine.bookmarks" name="services.sync.engine.bookmarks" type="bool"/>
      <preference id="engine.history"   name="services.sync.engine.history"   type="bool"/>
      <preference id="engine.tabs"      name="services.sync.engine.tabs"      type="bool"/>
      <preference id="engine.prefs"     name="services.sync.engine.prefs"     type="bool"/>
      <preference id="engine.passwords" name="services.sync.engine.passwords" type="bool"/>
    </preferences>


    <script type="application/javascript"
            src="chrome://browser/content/preferences/sync.js"/>
    <script type="application/javascript"
            src="chrome://browser/content/syncUtils.js"/>


      <deck id="weavePrefsDeck">
        <vbox id="noAccount" align="center">
          <spacer flex="1"/>
          <button id="setupButton"
                  label="&setupButton.label;"
                  accesskey="&setupButton.accesskey;"
                  oncommand="gSyncPane.openSetup();"/>
          <separator/>
          <description id="syncDesc" flex="1">
            &weaveDesc.label;
          </description>
          <spacer flex="3"/>
        </vbox>
        <vbox id="hasAccount">
          <groupbox>
            <caption label="&accountGroupboxCaption.label;"/>
            <grid>
              <rows>
                <row align="center">
                  <label value="&currentAccount.label;" control="currentAccount"/>
                  <textbox id="currentAccount" readonly="true">
                    <image/>
                  </textbox>
                  <hbox align="center">
                    <button id="connectButton" oncommand="gSyncPane.handleConnectCommand()"/>
                    <image id="connectThrobber"
                           hidden="true"/>
                  </hbox>
                </row>
                <row id="loginFeedbackRow" hidden="true">
                  <spacer/>
                  <label id="loginError" value=""/>
                  <hbox>
                    <label class="text-link"
                           onclick="gSyncPane.updatePass(); return false;"
                           value="&updatePass.label;"/>
                    <label class="text-link"
                           onclick="gSyncPane.resetPass(); return false;"
                           value="&resetPass.label;"/>
                  </hbox>
                </row>
                <!-- XXXzpao We should make this behave like the "details" view in CRH.
                             do in followup (bug 583441) -->
                <row id="manageAccountControls" hidden="true">
                  <spacer/>
                    <vbox class="indent">
                     <label class="text-link"
                             onclick="gSyncPane.openQuotaDialog(); return false;"
                             value="&viewQuota.label;"/>
                      <label class="text-link"
                             onclick="gSyncUtils.changePassword(); return false;"
                             value="&changePassword.label;"/>
                      <label class="text-link"
                             onclick="gSyncUtils.resetPassphrase(); return false;"
                             value="&mySyncKey.label;"/>
                      <label class="text-link"
                             onclick="gSyncPane.resetSync(); return false;"
                             value="&resetSync.label;"/>
                      <label class="text-link"
                             onclick="gSyncPane.startOver(true); return false;"
                             value="&stopUsingAccount.label;"/>
                    </vbox>
                  <spacer/>
                </row>
                <row>
                  <spacer/>
                  <button id="manageAccountExpander"
                          class="expander-down"
                          label="&manageAccount.label;"
                          accesskey="&manageAccount.accesskey;"
                          align="left"
                          oncommand="gSyncPane.handleExpanderClick()"/>
                  <spacer/>
                </row>
              </rows>
            </grid>
          </groupbox>
          <groupbox>
            <caption label="&syncPrefsCaption.label;"/>
            <grid>
              <columns>
                <column/>
                <column flex="1"/>
              </columns>
              <rows>
                <row align="center">
                  <label value="&syncComputerName.label;"
                         accesskey="&syncComputerName.accesskey;"
                         control="syncComputerName"/>
                  <textbox id="syncComputerName"
                           onchange="gSyncUtils.changeName(this)"/>
                </row>
                <row>
                  <label value="&syncMy.label;" />
                  <vbox>
                    <checkbox label="&engine.bookmarks.label;"
                              accesskey="&engine.bookmarks.accesskey;"
                              preference="engine.bookmarks"/>
                    <checkbox label="&engine.passwords.label;"
                              accesskey="&engine.passwords.accesskey;"
                              preference="engine.passwords"/>
                    <checkbox label="&engine.prefs.label;"
                              accesskey="&engine.prefs.accesskey;"
                              preference="engine.prefs"/>
                    <checkbox label="&engine.history.label;"
                              accesskey="&engine.history.accesskey;"
                              preference="engine.history"/>
                    <checkbox label="&engine.tabs.label;"
                              accesskey="&engine.tabs.accesskey;"
                              preference="engine.tabs"/>
                  </vbox>
                </row>
              </rows>
            </grid>
            <separator/>
          </groupbox>
          <hbox id="tosPP" pack="center">
            <label class="text-link"
                   onclick="event.stopPropagation();gSyncUtils.openToS();"
                   value="&prefs.tosLink.label;"/>
            <label class="text-link"
                   onclick="event.stopPropagation();gSyncUtils.openPrivacyPolicy();"
                   value="&prefs.ppLink.label;"/>
          </hbox>
        </vbox>
      </deck>
  </prefpane>
</overlay>
