summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/md_history/synced_device_card.html
blob: 9efd7ccb921b61a578dfe969a5e7cf20c3fcc6dc (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
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_row.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.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-icon-button/paper-icon-button-light.html">
<link rel="import" href="chrome://resources/html/icon.html">
<link rel="import" href="chrome://history/browser_service.html">
<link rel="import" href="chrome://history/constants.html">
<link rel="import" href="chrome://history/searched_label.html">
<link rel="import" href="chrome://history/shared_style.html">

<dom-module id="history-synced-device-card">
  <template>
    <style include="shared-style">
      :host {
        @apply --card-sizing;
        -webkit-tap-highlight-color: transparent;
        display: block;
        padding-bottom: var(--card-padding-between);
      }

      #card-heading {
        -webkit-padding-end: 0;
        cursor: pointer;
        justify-content: space-between;
      }

      #tab-item-list {
        padding: 8px 0;
      }

      #last-update-time {
        color: var(--cr-secondary-text-color);
      }

      #title-left-content {
        display: flex;
        overflow: hidden;
      }

      #device-name {
        overflow: hidden;
        padding-right: 3px;
        text-overflow: ellipsis;
      }

      #right-buttons {
        -webkit-margin-end: 12px;
        color: var(--cr-secondary-text-color);
      }

      #collapse {
        overflow: hidden;
      }

      #history-item-container {
        @apply --cr-card-elevation;
        background: #fff;
        border-radius: var(--cr-card-border-radius);
      }

      .item-container {
        align-items: center;
        display: flex;
        margin: 0 20px;
        min-height: var(--item-height);
      }

      .window-separator {
        background-color: var(--card-border-color);
        height: 1px;
        margin: 5px auto;
        width: 80%;
      }
    </style>
    <div id="history-item-container">
      <div class="card-title" id="card-heading" aria-expanded$="[[opened]]"
          aria-controls="collapse" on-click="toggleTabCard">
        <div id="title-left-content">
          <div id="device-name">
            [[device]]
          </div>
          <span id="last-update-time">[[lastUpdateTime]]</span>
        </div>
        <div id="right-buttons">
          <paper-icon-button-light class="more-vert-button">
            <button id="menu-button"
                on-click="onMenuButtonTap_" title="$i18n{moreActionsButton}">
              <div></div>
              <div></div>
              <div></div>
            </button>
          </paper-icon-button-light>
          <paper-icon-button-light>
            <button id="collapse-button" title$="[[getCollapseTitle_(opened)]]">
              <iron-icon icon="[[getCollapseIcon_(opened)]]"
                  id="dropdown-indicator">
              </iron-icon>
            </button>
          </paper-icon-button-light>
        </div>
      </div>

      <iron-collapse opened="{{opened}}" id="collapse">
        <div id="tab-item-list">
          <template is="dom-repeat" items="[[tabs]]" as="tab" id="tab-list"
              notify-dom-change>
            <div class="item-container">
              <div class="website-icon"></div>
              <a href="[[tab.url]]" class="website-title" title="[[tab.title]]"
                  on-click="openTab_" on-contextmenu="onLinkRightClick_">
                <history-searched-label title="[[tab.title]]"
                    search-term="[[searchTerm]]"></history-searched-label>
              </a>
            </div>
            <div class="window-separator"
                hidden$="[[!isWindowSeparatorIndex_(index, separatorIndexes)]]">
            </div>
          </template>
        </div>
      </iron-collapse>
    </div>
  </template>
  <script src="chrome://history/synced_device_card.js"></script>
</dom-module>