OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 WidgetGtk* window = new ClickNotifyingWidget(WidgetGtk::TYPE_WINDOW, this); | 380 WidgetGtk* window = new ClickNotifyingWidget(WidgetGtk::TYPE_WINDOW, this); |
381 ConfigureLoginWindow(window, | 381 ConfigureLoginWindow(window, |
382 index, | 382 index, |
383 gfx::Rect(0, 0, width, height), | 383 gfx::Rect(0, 0, width, height), |
384 type, | 384 type, |
385 label); | 385 label); |
386 return window; | 386 return window; |
387 } | 387 } |
388 | 388 |
389 gfx::Rect UserController::GetScreenBounds() const { | 389 gfx::Rect UserController::GetScreenBounds() const { |
390 if (is_guest_) { | 390 if (is_guest_) |
391 return new_user_view_->GetPasswordBounds(); | 391 return new_user_view_->GetUsernameBounds(); |
392 } else { | 392 else |
393 gfx::Rect screen_bounds(existing_user_view_->password_field()->bounds()); | 393 return existing_user_view_->password_field()->GetScreenBounds(); |
394 gfx::Point origin(screen_bounds.origin()); | |
395 views::View::ConvertPointToScreen( | |
396 existing_user_view_->password_field()->GetParent(), | |
397 &origin); | |
398 screen_bounds.set_origin(origin); | |
399 return screen_bounds; | |
400 } | |
401 } | 394 } |
402 | 395 |
403 void UserController::OnLogin(const std::string& username, | 396 void UserController::OnLogin(const std::string& username, |
404 const std::string& password) { | 397 const std::string& password) { |
405 user_.set_email(username); | 398 user_.set_email(username); |
406 delegate_->Login(this, UTF8ToUTF16(password)); | 399 delegate_->Login(this, UTF8ToUTF16(password)); |
407 } | 400 } |
408 | 401 |
409 void UserController::OnCreateAccount() { | 402 void UserController::OnCreateAccount() { |
410 delegate_->ActivateWizard(WizardController::kAccountScreenName); | 403 delegate_->ActivateWizard(WizardController::kAccountScreenName); |
(...skipping 21 matching lines...) Expand all Loading... |
432 | 425 |
433 void UserController::SelectUser(int index) { | 426 void UserController::SelectUser(int index) { |
434 delegate_->SelectUser(index); | 427 delegate_->SelectUser(index); |
435 } | 428 } |
436 | 429 |
437 void UserController::FocusPasswordField() { | 430 void UserController::FocusPasswordField() { |
438 existing_user_view_->password_field()->RequestFocus(); | 431 existing_user_view_->password_field()->RequestFocus(); |
439 } | 432 } |
440 | 433 |
441 } // namespace chromeos | 434 } // namespace chromeos |
OLD | NEW |