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