| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/chromeos/login/helper.h" |
| 10 #include "chrome/browser/chromeos/login/user_input.h" |
| 9 #include "views/accelerator.h" | 11 #include "views/accelerator.h" |
| 10 #include "views/controls/button/native_button.h" | 12 #include "views/controls/button/native_button.h" |
| 11 #include "views/controls/textfield/textfield.h" | 13 #include "views/controls/textfield/textfield.h" |
| 12 #include "views/view.h" | 14 #include "views/view.h" |
| 13 | 15 |
| 14 namespace chromeos { | 16 namespace chromeos { |
| 15 | 17 |
| 16 class UserController; | 18 class UserController; |
| 17 | 19 |
| 18 class ExistingUserView : public views::View { | 20 class ExistingUserView : public ThrobberHostView, |
| 21 public UserInput, |
| 22 public views::Textfield::Controller { |
| 19 public: | 23 public: |
| 20 explicit ExistingUserView(UserController* uc); | 24 explicit ExistingUserView(UserController* user_controller); |
| 21 | 25 |
| 22 void RecreateFields(); | 26 void RecreateFields(); |
| 23 | 27 |
| 24 views::Textfield* password_field() { return password_field_; } | |
| 25 | |
| 26 void FocusPasswordField(); | 28 void FocusPasswordField(); |
| 27 | 29 |
| 28 // Overridden from views::View: | 30 // Overridden from views::View: |
| 29 virtual bool AcceleratorPressed(const views::Accelerator& accelerator); | 31 virtual bool AcceleratorPressed(const views::Accelerator& accelerator); |
| 30 | 32 |
| 33 // Overriden from Textfield::Controller: |
| 34 virtual void ContentsChanged(views::Textfield* sender, |
| 35 const string16& new_contents); |
| 36 virtual bool HandleKeystroke(views::Textfield* sender, |
| 37 const views::Textfield::Keystroke& keystroke); |
| 38 |
| 39 // Overriden from UserInput: |
| 40 virtual void EnableInputControls(bool enabled); |
| 41 virtual void ClearAndFocusControls(); |
| 42 virtual void ClearAndFocusPassword(); |
| 43 virtual gfx::Rect GetMainInputScreenBounds() const; |
| 44 |
| 31 protected: | 45 protected: |
| 32 // Overridden from views::View: | 46 // Overridden from views::View: |
| 33 virtual void OnLocaleChanged(); | 47 virtual void OnLocaleChanged(); |
| 34 virtual void ViewHierarchyChanged(bool is_add, | 48 virtual void ViewHierarchyChanged(bool is_add, |
| 35 views::View* parent, | 49 views::View* parent, |
| 36 views::View* child); | 50 views::View* child); |
| 37 | 51 |
| 38 views::Accelerator accel_login_off_the_record_; | 52 private: |
| 53 UserController* user_controller_; |
| 39 | 54 |
| 40 // For editing the password. | 55 // For editing the password. |
| 41 views::Textfield* password_field_; | 56 views::Textfield* password_field_; |
| 42 | 57 |
| 43 UserController* user_controller_; | 58 views::Accelerator accel_login_off_the_record_; |
| 44 | |
| 45 private: | |
| 46 views::Accelerator accel_enable_accessibility_; | 59 views::Accelerator accel_enable_accessibility_; |
| 47 | 60 |
| 48 DISALLOW_COPY_AND_ASSIGN(ExistingUserView); | 61 DISALLOW_COPY_AND_ASSIGN(ExistingUserView); |
| 49 }; | 62 }; |
| 50 | 63 |
| 51 } // chromeos | 64 } // chromeos |
| 52 | 65 |
| 53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ | 66 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ |
| OLD | NEW |