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