| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual views::View* GetInitiallyFocusedView() OVERRIDE { | 69 virtual views::View* GetInitiallyFocusedView() OVERRIDE { |
| 70 return view_; | 70 return view_; |
| 71 } | 71 } |
| 72 | 72 |
| 73 virtual void OnWidgetActivated(bool active) OVERRIDE { | 73 virtual void OnWidgetActivated(bool active) OVERRIDE { |
| 74 controller_->OnWidgetActivated(active); | 74 controller_->OnWidgetActivated(active); |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual views::Widget* GetWidget() OVERRIDE { |
| 78 return view_->GetWidget(); |
| 79 } |
| 80 virtual const views::Widget* GetWidget() const OVERRIDE { |
| 81 return view_->GetWidget(); |
| 82 } |
| 83 |
| 77 private: | 84 private: |
| 78 UserController* controller_; | 85 UserController* controller_; |
| 79 | 86 |
| 80 // View to give focus to on show. | 87 // View to give focus to on show. |
| 81 views::View* view_; | 88 views::View* view_; |
| 82 | 89 |
| 83 DISALLOW_COPY_AND_ASSIGN(ControlsWidgetDelegate); | 90 DISALLOW_COPY_AND_ASSIGN(ControlsWidgetDelegate); |
| 84 }; | 91 }; |
| 85 | 92 |
| 86 using login::kBorderSize; | 93 using login::kBorderSize; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 if (active) { | 261 if (active) { |
| 255 delegate_->OnUserSelected(this); | 262 delegate_->OnUserSelected(this); |
| 256 user_view_->SetRemoveButtonVisible( | 263 user_view_->SetRemoveButtonVisible( |
| 257 !is_new_user_ && !is_guest_ && !is_owner_); | 264 !is_new_user_ && !is_guest_ && !is_owner_); |
| 258 } else { | 265 } else { |
| 259 user_view_->SetRemoveButtonVisible(false); | 266 user_view_->SetRemoveButtonVisible(false); |
| 260 delegate_->ClearErrors(); | 267 delegate_->ClearErrors(); |
| 261 } | 268 } |
| 262 } | 269 } |
| 263 | 270 |
| 271 views::Widget* UserController::GetWidget() { |
| 272 return NULL; |
| 273 } |
| 274 |
| 275 const views::Widget* UserController::GetWidget() const { |
| 276 return NULL; |
| 277 } |
| 278 |
| 264 //////////////////////////////////////////////////////////////////////////////// | 279 //////////////////////////////////////////////////////////////////////////////// |
| 265 // UserController, NewUserView::Delegate implementation: | 280 // UserController, NewUserView::Delegate implementation: |
| 266 // | 281 // |
| 267 void UserController::OnLogin(const std::string& username, | 282 void UserController::OnLogin(const std::string& username, |
| 268 const std::string& password) { | 283 const std::string& password) { |
| 269 if (is_new_user_) | 284 if (is_new_user_) |
| 270 user_.set_email(username); | 285 user_.set_email(username); |
| 271 | 286 |
| 272 user_input_->EnableInputControls(false); | 287 user_input_->EnableInputControls(false); |
| 273 StartThrobber(); | 288 StartThrobber(); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 std::wstring UserController::GetNameTooltip() const { | 521 std::wstring UserController::GetNameTooltip() const { |
| 507 if (is_new_user_) | 522 if (is_new_user_) |
| 508 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_ADD_USER)); | 523 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_ADD_USER)); |
| 509 else if (is_guest_) | 524 else if (is_guest_) |
| 510 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON)); | 525 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_GO_INCOGNITO_BUTTON)); |
| 511 else | 526 else |
| 512 return UTF8ToWide(user_.GetNameTooltip()); | 527 return UTF8ToWide(user_.GetNameTooltip()); |
| 513 } | 528 } |
| 514 | 529 |
| 515 } // namespace chromeos | 530 } // namespace chromeos |
| OLD | NEW |