- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / views / user_manager_view.h
1 // Copyright 2013 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_UI_VIEWS_USER_MANAGER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_USER_MANAGER_VIEW_H_
7
8 #include "chrome/browser/profiles/profile.h"
9 #include "ui/views/window/dialog_delegate.h"
10
11 namespace views {
12 class WebView;
13 }
14
15 // Dialog widget that contains the Desktop User Manager webui.
16 class UserManagerView : public views::DialogDelegateView {
17  public:
18   // Shows the User Manager or re-activates an existing one.
19   static void Show(const base::FilePath& profile_path_to_focus);
20
21   // Hide the User Manager.
22   static void Hide();
23
24   // Returns whether or not the User Manager is showing.
25   static bool IsShowing();
26
27  private:
28   explicit UserManagerView(Profile* profile);
29   virtual ~UserManagerView();
30
31   // If the |guest_profile| has been initialized succesfully (according to
32   // |status|), creates a new UserManagerView instance with the user with path
33   // |profile_path_to_focus| focused.
34   static void OnGuestProfileCreated(const base::FilePath& profile_path_to_focus,
35                                     Profile* guest_profile,
36                                     Profile::CreateStatus status);
37
38   // views::View:
39   virtual gfx::Size GetPreferredSize() OVERRIDE;
40
41   // views::DialogDelegateView:
42   virtual bool CanResize() const OVERRIDE;
43   virtual bool CanMaximize() const OVERRIDE;
44   virtual string16 GetWindowTitle() const OVERRIDE;
45   virtual int GetDialogButtons() const OVERRIDE;
46   virtual void WindowClosing() OVERRIDE;
47   virtual bool UseNewStyleForThisDialog() const OVERRIDE;
48
49   views::WebView* web_view_;
50
51   // An open User Manager window. There can only be one open at a time. This
52   // is reset to NULL when the window is closed.
53   static UserManagerView* instance_;
54
55   DISALLOW_COPY_AND_ASSIGN(UserManagerView);
56 };
57
58 #endif  // CHROME_BROWSER_UI_VIEWS_USER_MANAGER_VIEW_H_