Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Side by Side Diff: chrome/browser/resources/settings/controls/controlled_button.html

Issue 2617533003: MD Settings: change most checkboxes to toggles (leave dialogs alone) (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <link rel="import" href="chrome://resources/html/assert.html"> 1 <link rel="import" href="chrome://resources/html/assert.html">
2 <link rel="import" href="chrome://resources/html/polymer.html"> 2 <link rel="import" href="chrome://resources/html/polymer.html">
3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html"> 3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html">
4 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_be havior.html"> 4 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_be havior.html">
5 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_in dicator.html"> 5 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_in dicator.html">
6 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicat or_behavior.html">
6 <link rel="import" href="/controls/pref_control_behavior.html"> 7 <link rel="import" href="/controls/pref_control_behavior.html">
7 <link rel="import" href="/settings_shared_css.html"> 8 <link rel="import" href="/settings_shared_css.html">
8 9
9 <dom-module id="controlled-button"> 10 <dom-module id="controlled-button">
10 <template> 11 <template>
11 <style include="settings-shared"> 12 <style include="settings-shared">
12 :host { 13 :host {
13 align-items: center; 14 align-items: center;
14 display: flex; 15 display: flex;
15 } 16 }
16 17
17 :host([controlled_]) { 18 :host([controlled_]) {
18 /* Disable pointer events for this whole element, as outer on-tap gets 19 /* Disable pointer events for this whole element, as outer on-tap gets
19 * triggered when clicking/tapping anywhere in :host. */ 20 * triggered when clicking/tapping anywhere in :host. */
20 pointer-events: none; 21 pointer-events: none;
21 } 22 }
22 23
23 cr-policy-pref-indicator { 24 cr-policy-pref-indicator {
24 -webkit-margin-start: var(--checkbox-spacing);
25 /* Enable pointer events for the indicator so :hover works. Disable 25 /* Enable pointer events for the indicator so :hover works. Disable
26 * clicks/taps via onIndicatorTap_ so outer on-tap doesn't trigger. */ 26 * clicks/taps via onIndicatorTap_ so outer on-tap doesn't trigger. */
27 pointer-events: all; 27 pointer-events: all;
28 } 28 }
29
30 :host(:not([right-justified])) cr-policy-pref-indicator {
31 -webkit-margin-start: var(--checkbox-spacing);
dschuyler 2017/01/05 20:25:05 optional since this is just moving exiting code, b
Dan Beam 2017/01/06 02:45:29 Done.
32 }
33
34 :host([right-justified]) cr-policy-pref-indicator {
35 -webkit-margin-end: var(--checkbox-spacing);
36 order: -1;
37 }
29 </style> 38 </style>
30 39
31 <paper-button disabled="[[controlled_]]"> 40 <paper-button disabled="[[controlled_]]">
32 <content></content> 41 <content></content>
33 </paper-button> 42 </paper-button>
34 43
35 <template is="dom-if" if="[[controlled_]]"> 44 <template is="dom-if" if="[[showIndicator_(pref.controlledBy,
45 pref.enforcement)]]">
dschuyler 2017/01/05 20:25:05 This seems different from the checkbox to toggle c
Dan Beam 2017/01/06 02:45:29 split to a separate CL.
36 <cr-policy-pref-indicator pref="[[pref]]" on-tap="onIndicatorTap_"> 46 <cr-policy-pref-indicator pref="[[pref]]" on-tap="onIndicatorTap_">
37 </cr-policy-pref-indicator> 47 </cr-policy-pref-indicator>
38 </template> 48 </template>
39 49
40 </template> 50 </template>
41 <script src="/controls/controlled_button.js"></script> 51 <script src="/controls/controlled_button.js"></script>
42 </dom-module> 52 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698