Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 | 13 |
| 14 class UserManagerMac; | 14 class UserManagerMac; |
| 15 @class UserManagerWindowController; | 15 @class UserManagerWindowController; |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class NavigationController; | 18 class NavigationController; |
| 19 class WebContents; | 19 class WebContents; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // Dialog widget that contains the Desktop User Manager webui. | 22 // Dialog widget that contains the Desktop User Manager webui. |
| 23 class UserManagerMac { | 23 class UserManagerMac { |
| 24 public: | 24 public: |
| 25 // Shows the User Manager or re-activates an existing one, focusing the | 25 // Shows the User Manager or re-activates an existing one, focusing the |
| 26 // profile given by |profile_path_to_focus|. | 26 // profile given by |profile_path_to_focus|. If |show_tutorial| is true, |
| 27 static void Show(const base::FilePath& profile_path_to_focus); | 27 // then the user manager tutorial will be shown. |
| 28 static void Show(const base::FilePath& profile_path_to_focus, | |
| 29 bool show_tutorial); | |
|
Alexei Svitkine (slow)
2014/03/14 21:04:40
Can this be an enum instead so that it's obvious w
noms (inactive)
2014/03/17 21:52:23
Added an enum as in the future we might (very like
| |
| 28 | 30 |
| 29 // Hide the User Manager. | 31 // Hide the User Manager. |
| 30 static void Hide(); | 32 static void Hide(); |
| 31 | 33 |
| 32 // Returns whether or not the User Manager is showing. | 34 // Returns whether or not the User Manager is showing. |
| 33 static bool IsShowing(); | 35 static bool IsShowing(); |
| 34 | 36 |
| 35 // Called by the cocoa window controller when its window closes and the | 37 // Called by the cocoa window controller when its window closes and the |
| 36 // controller destroyed itself. Deletes the instance. | 38 // controller destroyed itself. Deletes the instance. |
| 37 void WindowWasClosed(); | 39 void WindowWasClosed(); |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 explicit UserManagerMac(Profile* profile); | 42 explicit UserManagerMac(Profile* profile); |
| 41 virtual ~UserManagerMac(); | 43 virtual ~UserManagerMac(); |
| 42 | 44 |
| 43 // If the |guest_profile| has been initialized succesfully (according to | 45 // If the |guest_profile| has been initialized succesfully (according to |
| 44 // |status|), creates a new UserManagerMac instance with the user with path | 46 // |status|), creates a new UserManagerMac instance with the user with path |
| 45 // |profile_path_to_focus| focused. | 47 // |profile_path_to_focus| focused. |
| 46 static void OnGuestProfileCreated(const base::FilePath& profile_path_to_focus, | 48 static void OnGuestProfileCreated(const base::FilePath& profile_path_to_focus, |
| 49 bool show_tutorial, | |
| 47 Profile* guest_profile, | 50 Profile* guest_profile, |
| 48 Profile::CreateStatus status); | 51 Profile::CreateStatus status); |
| 49 | 52 |
| 50 // An open User Manager window. There can only be one open at a time. This | 53 // 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. | 54 // is reset to NULL when the window is closed. |
| 52 static UserManagerMac* instance_; // Weak. | 55 static UserManagerMac* instance_; // Weak. |
| 53 | 56 |
| 54 // Controller of the window. | 57 // Controller of the window. |
| 55 base::scoped_nsobject<UserManagerWindowController> window_controller_; | 58 base::scoped_nsobject<UserManagerWindowController> window_controller_; |
| 56 | 59 |
| 57 DISALLOW_COPY_AND_ASSIGN(UserManagerMac); | 60 DISALLOW_COPY_AND_ASSIGN(UserManagerMac); |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 #endif // CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ | 63 #endif // CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ |
| OLD | NEW |