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.
5 #ifndef CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/profiles/profile.h"
15 @
class UserManagerWindowController
;
18 class NavigationController
;
22 // Dialog widget that contains the Desktop User Manager webui.
23 class UserManagerMac
{
25 // Shows the User Manager or re-activates an existing one, focusing the
26 // profile given by |profile_path_to_focus|.
27 static void Show(const base::FilePath
& profile_path_to_focus
);
29 // Hide the User Manager.
32 // Returns whether or not the User Manager is showing.
33 static bool IsShowing();
35 // Called by the cocoa window controller when its window closes and the
36 // controller destroyed itself. Deletes the instance.
37 void WindowWasClosed();
40 explicit UserManagerMac(Profile
* profile
);
41 virtual ~UserManagerMac();
43 // If the |guest_profile| has been initialized succesfully (according to
44 // |status|), creates a new UserManagerMac instance with the user with path
45 // |profile_path_to_focus| focused.
46 static void OnGuestProfileCreated(const base::FilePath
& profile_path_to_focus
,
47 Profile
* guest_profile
,
48 Profile::CreateStatus status
);
50 // An open User Manager window. There can only be one open at a time. This
51 // is reset to NULL when the window is closed.
52 static UserManagerMac
* instance_
; // Weak.
54 // Controller of the window.
55 base::scoped_nsobject
<UserManagerWindowController
> window_controller_
;
57 DISALLOW_COPY_AND_ASSIGN(UserManagerMac
);
60 #endif // CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_