Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / resources / settings / settings_ui / breadcrumb.js
blob6e5ad548d88d0eeac624d74aed367eb2b02ec29d
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 /**
6  * @fileoverview
7  * 'settings-breadcrumb' displays the breadcrumb.
8  *
9  * Example:
10  *
11  *     <settings-breadcrumb current-route="{{currentRoute}}">
12  *     </settings-breadcrumb>
13  *
14  * @group Chrome Settings Elements
15  * @element settings-breadcrumb
16  */
17 Polymer({
18   is: 'settings-breadcrumb',
20   properties: {
21     /**
22      * The current active route.
23      */
24     currentRoute: {
25       type: Object,
26       notify: true,
27     },
29     /**
30      * Page titles for the currently active route.
31      */
32     currentRouteTitles: {
33       type: Object,
34       observer: 'currentRouteTitlesChanged_',
35     },
36   },
38   /** @private */
39   onTapPage_: function() {
40     this.currentRoute = {
41       page: this.currentRoute.page,
42       section: '',
43       subpage: [],
44     };
45   },
47   /** @private */
48   onTapSubpage_: function(event) {
49     var clickedIndex = event.target.dataset.subpageIndex;
50     this.currentRoute = {
51       page: this.currentRoute.page,
52       section: this.currentRoute.section,
53       subpage: this.currentRoute.subpage.slice(0, clickedIndex + 1),
54     };
55   },
56 });