• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_GUEST_USER_VIEW_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_GUEST_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.h"
14 #include "views/view.h"
15 
16 namespace chromeos {
17 
18 class UserController;
19 
20 // This view is for controls window of Guest mode pod that allows user to
21 // get temporary profile and use it for browsing. Contains only one Sign-in
22 // button and handles different common keyboard shortcuts.
23 class GuestUserView : public ThrobberHostView,
24                       public UserInput,
25                       public views::ButtonListener {
26  public:
27   explicit GuestUserView(UserController* uc);
28 
29   void RecreateFields();
30 
31   // Overridden from views::View:
32   virtual bool AcceleratorPressed(const views::Accelerator& accelerator);
33   virtual void RequestFocus();
34 
35   // Overridden from views::ButtonListener.
36   virtual void ButtonPressed(views::Button* sender, const views::Event& event);
37 
38   // Overridden from UserInput:
39   virtual void EnableInputControls(bool enabled);
40   virtual void ClearAndFocusControls();
41   virtual void ClearAndFocusPassword();
42   virtual gfx::Rect GetMainInputScreenBounds() const;
43 
44  private:
45   // Overridden from views::View:
46   virtual void OnLocaleChanged();
47   virtual void Layout();
48 
49   // Button to start login.
50   views::NativeButton* submit_button_;
51 
52   UserController* user_controller_;
53 
54   views::Accelerator accel_toggle_accessibility_;
55   views::Accelerator accel_login_off_the_record_;
56   views::Accelerator accel_previous_pod_by_arrow_;
57   views::Accelerator accel_previous_pod_by_tab_;
58   views::Accelerator accel_next_pod_by_arrow_;
59   views::Accelerator accel_next_pod_by_tab_;
60 
61   DISALLOW_COPY_AND_ASSIGN(GuestUserView);
62 };
63 
64 }  // chromeos
65 
66 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_GUEST_USER_VIEW_H_
67