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

Unified Diff: chrome/browser/resources/settings/controls/controlled_button.html

Issue 2178273002: MD Settings: add a <controlled-button> that uses prefs to disable itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: asdf Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/controls/controlled_button.html
diff --git a/chrome/browser/resources/settings/controls/controlled_button.html b/chrome/browser/resources/settings/controls/controlled_button.html
new file mode 100644
index 0000000000000000000000000000000000000000..c23f44987d1d0097dfbfaae776d1df67f183159f
--- /dev/null
+++ b/chrome/browser/resources/settings/controls/controlled_button.html
@@ -0,0 +1,34 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_behavior.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
+<link rel="import" href="/controls/pref_control_behavior.html">
+<link rel="import" href="/settings_shared_css.html">
+
+<dom-module id="controlled-button">
+ <link rel="import" type="css" href="chrome://resources/cr_elements/shared.css">
+ <template>
+ <style include="settings-shared">
+ :host {
+ align-items: center;
+ display: flex;
+ }
+
+ cr-policy-pref-indicator {
+ -webkit-margin-start: var(--checkbox-spacing);
+ pointer-events: all;
+ }
+ </style>
+
+ <paper-button disabled="[[disabled]]">
+ <content></content>
+ </paper-button>
+
+ <template is="dom-if" if="[[disabled]]">
stevenjb 2016/07/26 19:50:09 If we use |disabled|, then I think this needs to b
Dan Beam 2016/07/26 22:28:40 change to controlled_
+ <cr-policy-pref-indicator pref="[[pref]]" on-tap="onIndicatorTap_">
+ </cr-policy-pref-indicator>
+ </template>
+
+ </template>
+ <script src="/controls/controlled_button.js"></script>
+</dom-module>

Powered by Google App Engine
This is Rietveld 408576698