| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 // New user login controls window is much higher than existing user's controls | 412 // New user login controls window is much higher than existing user's controls |
| 413 // window so window manager will place the control instead of image window. | 413 // window so window manager will place the control instead of image window. |
| 414 // New user will have 0 size border. | 414 // New user will have 0 size border. |
| 415 int width = controls_width; | 415 int width = controls_width; |
| 416 int height = controls_height; | 416 int height = controls_height; |
| 417 if (!is_new_user_) { | 417 if (!is_new_user_) { |
| 418 width += kBorderSize * 2; | 418 width += kBorderSize * 2; |
| 419 height += 2 * kBorderSize + kUserImageSize + kVerticalIntervalSize; | 419 height += 2 * kBorderSize + kUserImageSize + kVerticalIntervalSize; |
| 420 } | 420 } |
| 421 | 421 |
| 422 border_window_ = Widget::CreateWidget(); |
| 422 Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); | 423 Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); |
| 423 params.transparent = true; | 424 params.transparent = true; |
| 424 border_window_ = Widget::CreateWidget(params); | 425 params.bounds = gfx::Rect(0, 0, width, height); |
| 425 border_window_->Init(NULL, gfx::Rect(0, 0, width, height)); | 426 border_window_->Init(params); |
| 426 if (!is_new_user_) { | 427 if (!is_new_user_) { |
| 427 views::View* background_view = new views::View(); | 428 views::View* background_view = new views::View(); |
| 428 views::Painter* painter = CreateWizardPainter( | 429 views::Painter* painter = CreateWizardPainter( |
| 429 &BorderDefinition::kUserBorder); | 430 &BorderDefinition::kUserBorder); |
| 430 background_view->set_background( | 431 background_view->set_background( |
| 431 views::Background::CreateBackgroundPainter(true, painter)); | 432 views::Background::CreateBackgroundPainter(true, painter)); |
| 432 border_window_->SetContentsView(background_view); | 433 border_window_->SetContentsView(background_view); |
| 433 } | 434 } |
| 434 UpdateUserCount(index, total_user_count); | 435 UpdateUserCount(index, total_user_count); |
| 435 | 436 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 std::wstring UserController::GetNameTooltip() const { | 505 std::wstring UserController::GetNameTooltip() const { |
| 505 if (is_new_user_) | 506 if (is_new_user_) |
| 506 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_ADD_USER)); | 507 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_ADD_USER)); |
| 507 else if (is_guest_) | 508 else if (is_guest_) |
| 508 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON)); | 509 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON)); |
| 509 else | 510 else |
| 510 return UTF8ToWide(user_.GetNameTooltip()); | 511 return UTF8ToWide(user_.GetNameTooltip()); |
| 511 } | 512 } |
| 512 | 513 |
| 513 } // namespace chromeos | 514 } // namespace chromeos |
| OLD | NEW |