summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/settings/people_page/import_data_dialog.html
blob: 9eb241a1aba7cb9c04c98c16c15019a48d84f50e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/md_select_css.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="../controls/settings_checkbox.html">
<link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../icons.html">
<link rel="import" href="import_data_browser_proxy.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../settings_vars_css.html">

<dom-module id="settings-import-data-dialog">
  <template>
    <style include="settings-shared md-select">
      .description {
        align-items: center;
        display: flex;
        margin-top: 16px;
      }

      paper-spinner-lite {
        margin: 0 8px;
      }

      #successIcon {
        fill: var(--cr-checked-color);
        height: 80px;
        margin: auto;
        width: 100%;
      }

      /* Prevent focus-outline to be chopped by the bottom of dialog body. */
      .md-select {
        margin-top: 2px;
      }

    </style>
    <cr-dialog id="dialog" close-text="$i18n{close}"
        ignore-popstate>
      <div slot="title">$i18n{importTitle}</div>
      <div slot="body">
        <div hidden$="[[!hasImportStatus_(
            importStatusEnum_.SUCCEEDED, importStatus_)]]">
          <iron-icon id="successIcon" icon="settings:check-circle">
          </iron-icon>
          <div hidden$="[[!prefs.import_dialog_bookmarks.value]]">
            <div class="description">$i18n{importSuccess}</div>
            <settings-toggle-button class="first"
                label="$i18n{showBookmarksBar}"
                pref="{{prefs.bookmark_bar.show_on_all_tabs}}">
            </settings-toggle-button>
          </div>
        </div>

        <div hidden$="[[hasImportStatus_(
              importStatusEnum_.SUCCEEDED, importStatus_)]]">
          <select id="browserSelect" class="md-select"
              aria-label="$i18n{importFromLabel}"
              on-change="onBrowserProfileSelectionChange_">
            <template is="dom-repeat" items="[[browserProfiles_]]">
              <option value="[[item.index]]">[[item.name]]</option>
            </template>
          </select>
          <div class="description">$i18n{importDescription}</div>
          <settings-checkbox
              hidden="[[!selected_.history]]"
              pref="{{prefs.import_dialog_history}}"
              label="$i18n{importHistory}">
          </settings-checkbox>
          <settings-checkbox
              hidden="[[!selected_.favorites]]"
              pref="{{prefs.import_dialog_bookmarks}}"
              label="$i18n{importFavorites}">
          </settings-checkbox>
          <settings-checkbox
              hidden="[[!selected_.passwords]]"
              pref="{{prefs.import_dialog_saved_passwords}}"
              label="$i18n{importPasswords}">
          </settings-checkbox>
          <settings-checkbox
              hidden="[[!selected_.search]]"
              pref="{{prefs.import_dialog_search_engine}}"
              label="$i18n{importSearch}">
          </settings-checkbox>
          <settings-checkbox
              hidden="[[!selected_.autofillFormData]]"
              pref="{{prefs.import_dialog_autofill_form_data}}"
              label="$i18n{importAutofillFormData}">
          </settings-checkbox>
        </div>
      </div>
      <div slot="button-container">
        <paper-spinner-lite
            active="[[hasImportStatus_(
                importStatusEnum_.IN_PROGRESS, importStatus_)]]"
            hidden="[[hasImportStatus_(
                importStatusEnum_.SUCCEEDED, importStatus_)]]">
        </paper-spinner-lite>
        <cr-button id="cancel" class="cancel-button"
            hidden="[[hasImportStatus_(
                importStatusEnum_.SUCCEEDED, importStatus_)]]"
            disabled="[[hasImportStatus_(
                importStatusEnum_.IN_PROGRESS, importStatus_)]]"
            on-click="closeDialog_">
          $i18n{cancel}
        </cr-button>
        <cr-button id="import" class="action-button"
            hidden="[[hasImportStatus_(
                importStatusEnum_.SUCCEEDED, importStatus_)]]"
            disabled="[[shouldDisableImport_(
                importStatus_, noImportDataTypeSelected_)]]"
            on-click="onActionButtonTap_">
          [[getActionButtonText_(selected_)]]
        </cr-button>

        <cr-button id="done" class="action-button"
            hidden$="[[!hasImportStatus_(
                importStatusEnum_.SUCCEEDED, importStatus_)]]"
            on-click="closeDialog_">$i18n{done}</cr-button>
      </div>
    </cr-dialog>
  </template>
  <script src="import_data_dialog.js"></script>
:</dom-module>