1 // Copyright 2014 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_PROFILES_USER_MANAGER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_window.h"
10 #include "ui/views/window/dialog_delegate.h"
18 // Dialog widget that contains the Desktop User Manager webui.
19 class UserManagerView
: public views::DialogDelegateView
{
21 // Shows the User Manager or re-activates an existing one, focusing the
22 // profile given by |profile_path_to_focus|. Based on the value of
23 // |tutorial_mode|, a tutorial could be shown, in which case
24 // |profile_path_to_focus| is ignored.
25 static void Show(const base::FilePath
& profile_path_to_focus
,
26 profiles::UserManagerTutorialMode tutorial_mode
);
28 // Hide the User Manager.
31 // Returns whether or not the User Manager is showing.
32 static bool IsShowing();
35 explicit UserManagerView(Profile
* profile
);
36 virtual ~UserManagerView();
38 // Creates a new UserManagerView instance for the |guest_profile| and
40 static void OnGuestProfileCreated(Profile
* guest_profile
,
41 const std::string
& url
);
44 virtual gfx::Size
GetPreferredSize() OVERRIDE
;
46 // views::DialogDelegateView:
47 virtual bool CanResize() const OVERRIDE
;
48 virtual bool CanMaximize() const OVERRIDE
;
49 virtual base::string16
GetWindowTitle() const OVERRIDE
;
50 virtual int GetDialogButtons() const OVERRIDE
;
51 virtual void WindowClosing() OVERRIDE
;
52 virtual bool UseNewStyleForThisDialog() const OVERRIDE
;
54 views::WebView
* web_view_
;
56 scoped_ptr
<AutoKeepAlive
> keep_alive_
;
57 // An open User Manager window. There can only be one open at a time. This
58 // is reset to NULL when the window is closed.
59 static UserManagerView
* instance_
;
61 DISALLOW_COPY_AND_ASSIGN(UserManagerView
);
64 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_