cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / pdf / elements / viewer-bookmark / viewer-bookmark.js
blob0f6a593c7920626b69df854de544f29a5518af38
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 (function() {
6 /** Amount that each level of bookmarks is indented by (px). */
7 var BOOKMARK_INDENT = 20;
9 Polymer({
10 is: 'viewer-bookmark',
12 properties: {
13 /**
14 * A bookmark object, each containing a:
15 * - title
16 * - page (optional)
17 * - children (an array of bookmarks)
19 bookmark: {
20 type: Object,
21 observer: 'bookmarkChanged_'
24 depth: {
25 type: Number,
26 observer: 'depthChanged'
29 childDepth: Number,
31 childrenShown_: {
32 type: Boolean,
33 value: false
37 bookmarkChanged_: function() {
38 this.$.expand.style.visibility =
39 this.bookmark.children.length > 0 ? 'visible' : 'hidden';
42 depthChanged: function() {
43 this.childDepth = this.depth + 1;
44 this.$.item.style.paddingLeft = (this.depth * BOOKMARK_INDENT) + 'px';
47 onClick: function() {
48 if (this.bookmark.hasOwnProperty('page'))
49 this.fire('change-page', {page: this.bookmark.page});
52 toggleChildren: function(e) {
53 this.childrenShown_ = !this.childrenShown_;
54 if (this.childrenShown_)
55 this.$.expand.classList.add('open');
56 else
57 this.$.expand.classList.remove('open');
58 e.stopPropagation(); // Prevent the above onClick handler from firing.
60 });
61 })();