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