| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/login/user_controller.h" | 5 #include "chrome/browser/chromeos/login/user_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 widget->Show(); | 356 widget->Show(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 void UserController::SetupControlsWidget( | 359 void UserController::SetupControlsWidget( |
| 360 int index, | 360 int index, |
| 361 int* width, int* height, | 361 int* width, int* height, |
| 362 bool need_browse_without_signin) { | 362 bool need_browse_without_signin) { |
| 363 views::View* control_view; | 363 views::View* control_view; |
| 364 if (is_new_user_) { | 364 if (is_new_user_) { |
| 365 NewUserView* new_user_view = | 365 NewUserView* new_user_view = |
| 366 new NewUserView(this, true, need_browse_without_signin); | 366 new NewUserView(this, need_browse_without_signin); |
| 367 new_user_view->Init(); | 367 new_user_view->Init(); |
| 368 control_view = new_user_view; | 368 control_view = new_user_view; |
| 369 user_input_ = new_user_view; | 369 user_input_ = new_user_view; |
| 370 throbber_host_ = new_user_view; | 370 throbber_host_ = new_user_view; |
| 371 } else if (is_guest_) { | 371 } else if (is_guest_) { |
| 372 GuestUserView* guest_user_view = new GuestUserView(this); | 372 GuestUserView* guest_user_view = new GuestUserView(this); |
| 373 guest_user_view->RecreateFields(); | 373 guest_user_view->RecreateFields(); |
| 374 control_view = guest_user_view; | 374 control_view = guest_user_view; |
| 375 user_input_ = guest_user_view; | 375 user_input_ = guest_user_view; |
| 376 throbber_host_ = guest_user_view; | 376 throbber_host_ = guest_user_view; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 } else { | 480 } else { |
| 481 DCHECK(type == WM_IPC_WINDOW_LOGIN_UNSELECTED_LABEL); | 481 DCHECK(type == WM_IPC_WINDOW_LOGIN_UNSELECTED_LABEL); |
| 482 // TODO(altimofeev): switch to the rounded username view. | 482 // TODO(altimofeev): switch to the rounded username view. |
| 483 label = UsernameView::CreateShapedUsernameView( | 483 label = UsernameView::CreateShapedUsernameView( |
| 484 UTF16ToWideHack(text), true); | 484 UTF16ToWideHack(text), true); |
| 485 } | 485 } |
| 486 | 486 |
| 487 const gfx::Font& font = (type == WM_IPC_WINDOW_LOGIN_LABEL) ? | 487 const gfx::Font& font = (type == WM_IPC_WINDOW_LOGIN_LABEL) ? |
| 488 GetLabelFont() : GetUnselectedLabelFont(); | 488 GetLabelFont() : GetUnselectedLabelFont(); |
| 489 label->SetFont(font); | 489 label->SetFont(font); |
| 490 label->SetColor(login::kTextColor); | 490 label->SetAutoColorReadabilityEnabled(false); |
| 491 label->SetEnabledColor(login::kTextColor); |
| 491 | 492 |
| 492 if (type == WM_IPC_WINDOW_LOGIN_LABEL) | 493 if (type == WM_IPC_WINDOW_LOGIN_LABEL) |
| 493 label_view_ = label; | 494 label_view_ = label; |
| 494 else | 495 else |
| 495 unselected_label_view_ = label; | 496 unselected_label_view_ = label; |
| 496 | 497 |
| 497 int width = (type == WM_IPC_WINDOW_LOGIN_LABEL) ? | 498 int width = (type == WM_IPC_WINDOW_LOGIN_LABEL) ? |
| 498 kUserImageSize : kUnselectedSize; | 499 kUserImageSize : kUnselectedSize; |
| 499 if (is_new_user_) { | 500 if (is_new_user_) { |
| 500 // Make label as small as possible to don't show tooltip. | 501 // Make label as small as possible to don't show tooltip. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 523 string16 UserController::GetNameTooltip() const { | 524 string16 UserController::GetNameTooltip() const { |
| 524 if (is_new_user_) | 525 if (is_new_user_) |
| 525 return l10n_util::GetStringUTF16(IDS_ADD_USER); | 526 return l10n_util::GetStringUTF16(IDS_ADD_USER); |
| 526 else if (is_guest_) | 527 else if (is_guest_) |
| 527 return l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON); | 528 return l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON); |
| 528 else | 529 else |
| 529 return UTF8ToUTF16(user_.GetNameTooltip()); | 530 return UTF8ToUTF16(user_.GetNameTooltip()); |
| 530 } | 531 } |
| 531 | 532 |
| 532 } // namespace chromeos | 533 } // namespace chromeos |
| OLD | NEW |