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

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
« no previous file with comments | « ash/system/user/user_card_view.h ('k') | chrome/app/chromeos_strings.grdp » ('j') | 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/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 if (login_status == user::LOGGED_IN_PUBLIC) {
343 case user::LOGGED_IN_RETAIL_MODE: 343 AddPublicModeUserContent(max_width);
344 AddRetailModeUserContent(); 344 } else {
345 break; 345 AddUserContent(login_status, multiprofile_index);
346 case user::LOGGED_IN_PUBLIC:
347 AddPublicModeUserContent(max_width);
348 break;
349 default:
350 AddUserContent(login_status, multiprofile_index);
351 break;
352 } 346 }
353 } 347 }
354 348
355 UserCardView::~UserCardView() {} 349 UserCardView::~UserCardView() {}
356 350
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) { 351 void UserCardView::AddPublicModeUserContent(int max_width) {
366 views::View* icon = CreateIcon(user::LOGGED_IN_PUBLIC, 0); 352 views::View* icon = CreateIcon(user::LOGGED_IN_PUBLIC, 0);
367 AddChildView(icon); 353 AddChildView(icon);
368 int details_max_width = max_width - icon->GetPreferredSize().width() - 354 int details_max_width = max_width - icon->GetPreferredSize().width() -
369 kTrayPopupPaddingBetweenItems; 355 kTrayPopupPaddingBetweenItems;
370 AddChildView(new PublicAccountUserDetails(details_max_width)); 356 AddChildView(new PublicAccountUserDetails(details_max_width));
371 } 357 }
372 358
373 void UserCardView::AddUserContent(user::LoginStatus login_status, 359 void UserCardView::AddUserContent(user::LoginStatus login_status,
374 int multiprofile_index) { 360 int multiprofile_index) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 content::BrowserContext* context = 455 content::BrowserContext* context =
470 delegate->GetBrowserContextByIndex(multiprofile_index); 456 delegate->GetBrowserContextByIndex(multiprofile_index);
471 icon->SetImage(delegate->GetUserInfo(context)->GetImage(), 457 icon->SetImage(delegate->GetUserInfo(context)->GetImage(),
472 gfx::Size(kTrayAvatarSize, kTrayAvatarSize)); 458 gfx::Size(kTrayAvatarSize, kTrayAvatarSize));
473 } 459 }
474 return icon; 460 return icon;
475 } 461 }
476 462
477 } // namespace tray 463 } // namespace tray
478 } // namespace ash 464 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/user/user_card_view.h ('k') | chrome/app/chromeos_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698