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

Side by Side Diff: ash/system/user/accounts_detailed_view.cc

Issue 291233004: Updated tray assets for "new-profile-management" mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ash/resources/default_200_percent/cros/status/status_remove_account_hover.png ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/user/accounts_detailed_view.h" 5 #include "ash/system/user/accounts_detailed_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/multi_profile_uma.h" 9 #include "ash/multi_profile_uma.h"
10 #include "ash/session/user_info.h" 10 #include "ash/session/user_info.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 AddChildView(add_account_button); 134 AddChildView(add_account_button);
135 add_account_button_ = add_account_button; 135 add_account_button_ = add_account_button;
136 } 136 }
137 137
138 void AccountsDetailedView::AddFooter() { 138 void AccountsDetailedView::AddFooter() {
139 CreateSpecialRow(IDS_ASH_STATUS_TRAY_ACCOUNTS_TITLE, this); 139 CreateSpecialRow(IDS_ASH_STATUS_TRAY_ACCOUNTS_TITLE, this);
140 if (!IsMultiProfileSupportedAndUserActive()) 140 if (!IsMultiProfileSupportedAndUserActive())
141 return; 141 return;
142 TrayPopupHeaderButton* add_user_button = 142 TrayPopupHeaderButton* add_user_button =
143 new TrayPopupHeaderButton(this, 143 new TrayPopupHeaderButton(this,
144 IDR_AURA_UBER_TRAY_NETWORK_INFO, 144 IDR_AURA_UBER_TRAY_ADD_PROFILE,
145 IDR_AURA_UBER_TRAY_NETWORK_INFO, 145 IDR_AURA_UBER_TRAY_ADD_PROFILE,
146 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, 146 IDR_AURA_UBER_TRAY_ADD_PROFILE_HOVER,
147 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, 147 IDR_AURA_UBER_TRAY_ADD_PROFILE_HOVER,
148 IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT); 148 IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT);
149 add_user_button->SetTooltipText( 149 add_user_button->SetTooltipText(
150 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT)); 150 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SIGN_IN_ANOTHER_ACCOUNT));
151 footer()->AddButton(add_user_button); 151 footer()->AddButton(add_user_button);
152 add_user_button_ = add_user_button; 152 add_user_button_ = add_user_button;
153 } 153 }
154 154
155 void AccountsDetailedView::UpdateAccountList() { 155 void AccountsDetailedView::UpdateAccountList() {
156 // Clear existing view. 156 // Clear existing view.
157 delete_button_to_account_id_.clear(); 157 delete_button_to_account_id_.clear();
158 account_list_->RemoveAllChildViews(true); 158 account_list_->RemoveAllChildViews(true);
159 159
160 // Configuring layout manager. 160 // Configuring layout manager.
161 views::GridLayout* layout = new views::GridLayout(account_list_); 161 views::GridLayout* layout = new views::GridLayout(account_list_);
162 account_list_->SetLayoutManager(layout); 162 account_list_->SetLayoutManager(layout);
163 views::ColumnSet* primary_account_row = 163 views::ColumnSet* primary_account_row =
164 layout->AddColumnSet(kPrimaryAccountColumnSetID); 164 layout->AddColumnSet(kPrimaryAccountColumnSetID);
165 primary_account_row->AddColumn(views::GridLayout::LEADING, 165 primary_account_row->AddColumn(views::GridLayout::LEADING,
166 views::GridLayout::BASELINE, 166 views::GridLayout::CENTER,
167 1.0, 167 1.0,
168 views::GridLayout::USE_PREF, 168 views::GridLayout::USE_PREF,
169 0, 169 0,
170 0); 170 0);
171 views::ColumnSet* secondary_account_row = 171 views::ColumnSet* secondary_account_row =
172 layout->AddColumnSet(kSecondaryAccountColumnSetID); 172 layout->AddColumnSet(kSecondaryAccountColumnSetID);
173 secondary_account_row->AddColumn(views::GridLayout::FILL, 173 secondary_account_row->AddColumn(views::GridLayout::FILL,
174 views::GridLayout::BASELINE, 174 views::GridLayout::CENTER,
175 1.0, 175 1.0,
176 views::GridLayout::USE_PREF, 176 views::GridLayout::USE_PREF,
177 0, 177 0,
178 0); 178 0);
179 secondary_account_row->AddPaddingColumn(0.0, kTrayPopupPaddingBetweenItems); 179 secondary_account_row->AddPaddingColumn(0.0, kTrayPopupPaddingBetweenItems);
180 secondary_account_row->AddColumn(views::GridLayout::FILL, 180 secondary_account_row->AddColumn(views::GridLayout::FILL,
181 views::GridLayout::BASELINE, 181 views::GridLayout::CENTER,
182 0.0, 182 0.0,
183 views::GridLayout::USE_PREF, 183 views::GridLayout::USE_PREF,
184 0, 184 0,
185 0); 185 0);
186 186
187 // Adding primary account. 187 // Adding primary account.
188 layout->AddPaddingRow(0.0, kPaddingBetweenAccounts); 188 layout->AddPaddingRow(0.0, kPaddingBetweenAccounts);
189 layout->StartRow(0.0, kPrimaryAccountColumnSetID); 189 layout->StartRow(0.0, kPrimaryAccountColumnSetID);
190 const std::string& primary_account = delegate_->GetPrimaryAccountId(); 190 const std::string& primary_account = delegate_->GetPrimaryAccountId();
191 views::Label* primary_account_label = 191 views::Label* primary_account_label =
(...skipping 19 matching lines...) Expand all
211 layout->AddView(delete_button); 211 layout->AddView(delete_button);
212 } 212 }
213 213
214 scroll_content()->SizeToPreferredSize(); 214 scroll_content()->SizeToPreferredSize();
215 scroller()->Layout(); 215 scroller()->Layout();
216 } 216 }
217 217
218 views::View* AccountsDetailedView::CreateDeleteButton() { 218 views::View* AccountsDetailedView::CreateDeleteButton() {
219 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 219 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
220 views::ImageButton* delete_button = new views::ImageButton(this); 220 views::ImageButton* delete_button = new views::ImageButton(this);
221 delete_button->SetImage(views::Button::STATE_NORMAL, 221 delete_button->SetImage(
222 rb.GetImageNamed(IDR_CLOSE_2).ToImageSkia()); 222 views::Button::STATE_NORMAL,
223 delete_button->SetImage(views::Button::STATE_HOVERED, 223 rb.GetImageNamed(IDR_AURA_UBER_TRAY_REMOVE_ACCOUNT).ToImageSkia());
224 rb.GetImageNamed(IDR_CLOSE_2_H).ToImageSkia()); 224 delete_button->SetImage(
225 delete_button->SetImage(views::Button::STATE_PRESSED, 225 views::Button::STATE_HOVERED,
226 rb.GetImageNamed(IDR_CLOSE_2_P).ToImageSkia()); 226 rb.GetImageNamed(IDR_AURA_UBER_TRAY_REMOVE_ACCOUNT_HOVER).ToImageSkia());
227 delete_button->SetImage(
228 views::Button::STATE_PRESSED,
229 rb.GetImageNamed(IDR_AURA_UBER_TRAY_REMOVE_ACCOUNT_HOVER).ToImageSkia());
227 return delete_button; 230 return delete_button;
228 } 231 }
229 232
230 } // namespace tray 233 } // namespace tray
231 } // namespace ash 234 } // namespace ash
OLDNEW
« no previous file with comments | « ash/resources/default_200_percent/cros/status/status_remove_account_hover.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698