Add a minor text member to ui::MenuModel.
[chromium-blink-merge.git] / chrome / browser / ui / views / login_view.h
blob4ebfed05c6cddf282b2a8e8b756382079336337b
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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOGIN_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOGIN_VIEW_H_
8 #include "chrome/browser/ui/login/login_model.h"
9 #include "ui/views/view.h"
11 namespace views {
12 class Label;
13 class Textfield;
14 class LoginModel;
15 } // namespace views
17 // This class is responsible for displaying the contents of a login window
18 // for HTTP/FTP authentication.
19 class LoginView : public views::View, public LoginModelObserver {
20 public:
21 // |model| is observed for the entire lifetime of the LoginView.
22 // Therefore |model| should not be destroyed before the LoginView
23 // object.
24 LoginView(const string16& explanation,
25 LoginModel* model);
26 virtual ~LoginView();
28 // Access the data in the username/password text fields.
29 string16 GetUsername();
30 string16 GetPassword();
32 // LoginModelObserver implementation.
33 virtual void OnAutofillDataAvailable(const string16& username,
34 const string16& password) OVERRIDE;
35 virtual void OnLoginModelDestroying() OVERRIDE;
37 // Used by LoginHandlerWin to set the initial focus.
38 views::View* GetInitiallyFocusedView();
40 private:
41 // Non-owning refs to the input text fields.
42 views::Textfield* username_field_;
43 views::Textfield* password_field_;
45 // Button labels
46 views::Label* username_label_;
47 views::Label* password_label_;
49 // Authentication message.
50 views::Label* message_label_;
52 // If not null, points to a model we need to notify of our own destruction
53 // so it doesn't try and access this when its too late.
54 LoginModel* login_model_;
56 DISALLOW_COPY_AND_ASSIGN(LoginView);
59 #endif // CHROME_BROWSER_UI_VIEWS_LOGIN_VIEW_H_