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

Side by Side Diff: chrome/browser/resources/settings/people_page/manage_profile.html

Issue 2068713003: Refactors profile avatar selector into a Polymer element to use in md-settings & md-user-manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/cr_elements/cr_profile_avatar_select or/cr_profile_avatar_selector.html">
1 <link rel="import" href="chrome://resources/html/polymer.html"> 2 <link rel="import" href="chrome://resources/html/polymer.html">
2 <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> 3 <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
3 <link rel="import" href="chrome://resources/polymer/v1_0/iron-selector/iron-sele ctor.html">
4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html">
5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input .html"> 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input .html">
6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.htm l"> 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.htm l">
7 <link rel="import" href="/people_page/manage_profile_browser_proxy.html"> 6 <link rel="import" href="/people_page/manage_profile_browser_proxy.html">
8 <link rel="import" href="/settings_shared_css.html"> 7 <link rel="import" href="/settings_shared_css.html">
9 8
10 <dom-module id="settings-manage-profile"> 9 <dom-module id="settings-manage-profile">
11 <template> 10 <template>
12 <style include="settings-shared"> 11 <style include="settings-shared">
13 #availableIcons { 12 cr-profile-avatar-selector {
14 -webkit-margin-start: 16px; 13 -webkit-margin-start: 16px;
15 margin-top: 16px; 14 margin-top: 16px;
16 max-width: 600px; 15 max-width: 624px;
17 } 16 --avatar-selector-avatar-hovered: {
18 17 @apply(--shadow-elevation-2dp);
19 #selector { 18 };
20 display: flex;
21 flex-wrap: wrap;
22 }
23
24 /* Special style for Manage Profile icon grid buttons only. */
25 paper-button {
26 align-items: center;
27 background-color: var(--paper-grey-300);
28 border: 1px solid var(--paper-grey-300);
29 border-radius: 4px;
30 display: flex;
31 height: 48px;
32 justify-content: center;
33 margin: 8px;
34 padding: 0;
35 width: 48px;
36 }
37
38 paper-button:hover {
39 @apply(--shadow-elevation-2dp);
40 }
41
42 paper-button.iron-selected {
43 border: 1px solid var(--google-blue-500);
44 } 19 }
45 </style> 20 </style>
46 <div class="settings-box first"> 21 <div class="settings-box first">
47 <paper-input id="name" value="{{profileName}}" pattern=".*\S.*" 22 <paper-input id="name" value="{{profileName}}" pattern=".*\S.*"
48 auto-validate required on-change="onProfileNameChanged_"> 23 auto-validate required on-change="onProfileNameChanged_">
49 </paper-input> 24 </paper-input>
50 </div> 25 </div>
51 <div id="availableIcons"> 26 <cr-profile-avatar-selector avatars="[[availableIcons]]"
52 <iron-selector id="selector" on-iron-activate="onIconActivate_" 27 selected-avatar-url="[[profileIconUrl]]"
tommycli 2016/06/14 23:50:59 Perhaps the tests are failing because this needs t
Moe 2016/06/15 19:35:00 [[profileIconUrl]] should probably change to {{pro
53 selected="[[profileIconUrl]]" attr-for-selected="data-icon-url"> 28 on-selected-avatar-url-changed="onSelectedIconChanged_">
54 <template is="dom-repeat" items="[[availableIconUrls]]"> 29 </cr-profile-avatar-selector>
55 <paper-button data-icon-url$="[[item]]">
56 <img src="[[item]]">
57 </paper-button>
58 </template>
59 </iron-selector>
60 </div>
61 </template> 30 </template>
62 <script src="manage_profile.js"></script> 31 <script src="manage_profile.js"></script>
63 </dom-module> 32 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698