| OLD | NEW |
| (Empty) | |
| 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_COCOA_USER_MANAGER_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/profiles/profile.h" |
| 12 |
| 13 class UserManagerMac; |
| 14 |
| 15 namespace content { |
| 16 class NavigationController; |
| 17 class WebContents; |
| 18 } |
| 19 |
| 20 // Window controller for the User Manager view. |
| 21 @interface UserManagerWindowController : NSWindowController <NSWindowDelegate> { |
| 22 @private |
| 23 scoped_ptr<content::WebContents> webContents_; |
| 24 UserManagerMac* userManagerObserver_; // Weak. |
| 25 } |
| 26 |
| 27 - (id)initWithProfile:(Profile*) profile |
| 28 withObserver:(UserManagerMac*) userManagerObserver; |
| 29 - (void)showURL:(GURL)url; |
| 30 - (void)show; |
| 31 - (void)hide; |
| 32 @end |
| 33 |
| 34 // Dialog widget that contains the Desktop User Manager webui. |
| 35 class UserManagerMac { |
| 36 public: |
| 37 // Shows the User Manager or re-activates an existing one, focusing the |
| 38 // profile given by |profile_path_to_focus|. |
| 39 static void Show(const base::FilePath& profile_path_to_focus); |
| 40 |
| 41 // Hide the User Manager. |
| 42 static void Hide(); |
| 43 |
| 44 // Returns whether or not the User Manager is showing. |
| 45 static bool IsShowing(); |
| 46 |
| 47 // Called by the cocoa window controller when its window closes and the |
| 48 // controller destroyed itself. Deletes the instance. |
| 49 void WindowWasClosed(); |
| 50 |
| 51 private: |
| 52 explicit UserManagerMac(Profile* profile); |
| 53 virtual ~UserManagerMac(); |
| 54 |
| 55 // If the |guest_profile| has been initialized succesfully (according to |
| 56 // |status|), creates a new UserManagerMac instance with the user with path |
| 57 // |profile_path_to_focus| focused. |
| 58 static void OnGuestProfileCreated(const base::FilePath& profile_path_to_focus, |
| 59 Profile* guest_profile, |
| 60 Profile::CreateStatus status); |
| 61 |
| 62 // An open User Manager window. There can only be one open at a time. This |
| 63 // is reset to NULL when the window is closed. |
| 64 static UserManagerMac* instance_; // Weak. |
| 65 |
| 66 // Controller of the window. Destroys itself when the user manager window |
| 67 // is closed. |
| 68 UserManagerWindowController* window_controller_; // Weak. |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(UserManagerMac); |
| 71 }; |
| 72 |
| 73 #endif // CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ |
| OLD | NEW |