| 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 #include "chrome/browser/profiles/profile_window.h" |
| 13 | 14 |
| 14 class UserManagerMac; | 15 class UserManagerMac; |
| 15 @class UserManagerWindowController; | 16 @class UserManagerWindowController; |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 class NavigationController; | 19 class NavigationController; |
| 19 class WebContents; | 20 class WebContents; |
| 20 } | 21 } |
| 21 | 22 |
| 22 // Dialog widget that contains the Desktop User Manager webui. | 23 // Dialog widget that contains the Desktop User Manager webui. |
| 23 class UserManagerMac { | 24 class UserManagerMac { |
| 24 public: | 25 public: |
| 25 // Shows the User Manager or re-activates an existing one, focusing the | 26 // Shows the User Manager or re-activates an existing one, focusing the |
| 26 // profile given by |profile_path_to_focus|. | 27 // profile given by |profile_path_to_focus|. Based on the value of |
| 27 static void Show(const base::FilePath& profile_path_to_focus); | 28 // |tutorial_mode|, a tutorial could be shown, in which case |
| 29 // |profile_path_to_focus| is ignored. |
| 30 static void Show(const base::FilePath& profile_path_to_focus, |
| 31 profiles::UserManagerTutorialMode tutorial_mode); |
| 28 | 32 |
| 29 // Hide the User Manager. | 33 // Hide the User Manager. |
| 30 static void Hide(); | 34 static void Hide(); |
| 31 | 35 |
| 32 // Returns whether or not the User Manager is showing. | 36 // Returns whether or not the User Manager is showing. |
| 33 static bool IsShowing(); | 37 static bool IsShowing(); |
| 34 | 38 |
| 35 // Called by the cocoa window controller when its window closes and the | 39 // Called by the cocoa window controller when its window closes and the |
| 36 // controller destroyed itself. Deletes the instance. | 40 // controller destroyed itself. Deletes the instance. |
| 37 void WindowWasClosed(); | 41 void WindowWasClosed(); |
| 38 | 42 |
| 39 private: | 43 private: |
| 40 explicit UserManagerMac(Profile* profile); | 44 explicit UserManagerMac(Profile* profile); |
| 41 virtual ~UserManagerMac(); | 45 virtual ~UserManagerMac(); |
| 42 | 46 |
| 43 // If the |guest_profile| has been initialized succesfully (according to | 47 // If the |guest_profile| has been initialized succesfully (according to |
| 44 // |status|), creates a new UserManagerMac instance with the user with path | 48 // |status|), creates a new UserManagerMac instance and shows the |url|. |
| 45 // |profile_path_to_focus| focused. | 49 static void OnGuestProfileCreated(Profile* guest_profile, |
| 46 static void OnGuestProfileCreated(const base::FilePath& profile_path_to_focus, | 50 const std::string& url); |
| 47 Profile* guest_profile, | |
| 48 Profile::CreateStatus status); | |
| 49 | 51 |
| 50 // An open User Manager window. There can only be one open at a time. This | 52 // 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. | 53 // is reset to NULL when the window is closed. |
| 52 static UserManagerMac* instance_; // Weak. | 54 static UserManagerMac* instance_; // Weak. |
| 53 | 55 |
| 54 // Controller of the window. | 56 // Controller of the window. |
| 55 base::scoped_nsobject<UserManagerWindowController> window_controller_; | 57 base::scoped_nsobject<UserManagerWindowController> window_controller_; |
| 56 | 58 |
| 57 DISALLOW_COPY_AND_ASSIGN(UserManagerMac); | 59 DISALLOW_COPY_AND_ASSIGN(UserManagerMac); |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 #endif // CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ | 62 #endif // CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_ |
| OLD | NEW |