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

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

Issue 608283003: Remove retail mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 // 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/user_card_view.h" 5 #include "ash/system/user/user_card_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/session/session_state_delegate.h" 10 #include "ash/session/session_state_delegate.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 line_count * line_height + link_extra_height + insets.height()); 332 line_count * line_height + link_extra_height + insets.height());
333 } 333 }
334 334
335 } // namespace 335 } // namespace
336 336
337 UserCardView::UserCardView(user::LoginStatus login_status, 337 UserCardView::UserCardView(user::LoginStatus login_status,
338 int max_width, 338 int max_width,
339 int multiprofile_index) { 339 int multiprofile_index) {
340 SetLayoutManager(new views::BoxLayout( 340 SetLayoutManager(new views::BoxLayout(
341 views::BoxLayout::kHorizontal, 0, 0, kTrayPopupPaddingBetweenItems)); 341 views::BoxLayout::kHorizontal, 0, 0, kTrayPopupPaddingBetweenItems));
342 switch (login_status) { 342 switch (login_status) {
bartfab (slow) 2014/12/02 21:25:26 Nit: This can become a simple if/else now.
rkc 2014/12/04 19:50:06 Done.
343 case user::LOGGED_IN_RETAIL_MODE:
344 AddRetailModeUserContent();
345 break;
346 case user::LOGGED_IN_PUBLIC: 343 case user::LOGGED_IN_PUBLIC:
347 AddPublicModeUserContent(max_width); 344 AddPublicModeUserContent(max_width);
348 break; 345 break;
349 default: 346 default:
350 AddUserContent(login_status, multiprofile_index); 347 AddUserContent(login_status, multiprofile_index);
351 break; 348 break;
352 } 349 }
353 } 350 }
354 351
355 UserCardView::~UserCardView() {} 352 UserCardView::~UserCardView() {}
356 353
357 void UserCardView::AddRetailModeUserContent() {
358 views::Label* details = new views::Label;
359 details->SetText(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_KIOSK_LABEL));
360 details->SetBorder(views::Border::CreateEmptyBorder(0, 4, 0, 1));
361 details->SetHorizontalAlignment(gfx::ALIGN_LEFT);
362 AddChildView(details);
363 }
364
365 void UserCardView::AddPublicModeUserContent(int max_width) { 354 void UserCardView::AddPublicModeUserContent(int max_width) {
366 views::View* icon = CreateIcon(user::LOGGED_IN_PUBLIC, 0); 355 views::View* icon = CreateIcon(user::LOGGED_IN_PUBLIC, 0);
367 AddChildView(icon); 356 AddChildView(icon);
368 int details_max_width = max_width - icon->GetPreferredSize().width() - 357 int details_max_width = max_width - icon->GetPreferredSize().width() -
369 kTrayPopupPaddingBetweenItems; 358 kTrayPopupPaddingBetweenItems;
370 AddChildView(new PublicAccountUserDetails(details_max_width)); 359 AddChildView(new PublicAccountUserDetails(details_max_width));
371 } 360 }
372 361
373 void UserCardView::AddUserContent(user::LoginStatus login_status, 362 void UserCardView::AddUserContent(user::LoginStatus login_status,
374 int multiprofile_index) { 363 int multiprofile_index) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 content::BrowserContext* context = 458 content::BrowserContext* context =
470 delegate->GetBrowserContextByIndex(multiprofile_index); 459 delegate->GetBrowserContextByIndex(multiprofile_index);
471 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), 460 icon->SetImage(delegate->GetUserInfo(context)->GetImage(),
472 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); 461 gfx::Size(kTrayAvatarSize, kTrayAvatarSize));
473 } 462 }
474 return icon; 463 return icon;
475 } 464 }
476 465
477 } // namespace tray 466 } // namespace tray
478 } // namespace ash 467 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698