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_PROFILES_PROFILE_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "chrome/browser/profiles/profile_metrics.h" | 9 #include "chrome/browser/profiles/profile_metrics.h" |
10 #include "chrome/browser/ui/host_desktop.h" | 10 #include "chrome/browser/ui/host_desktop.h" |
11 #include "chrome/browser/ui/startup/startup_types.h" | 11 #include "chrome/browser/ui/startup/startup_types.h" |
12 | 12 |
13 class Profile; | 13 class Profile; |
14 namespace base { class FilePath; } | 14 namespace base { class FilePath; } |
15 | 15 |
16 namespace profiles { | 16 namespace profiles { |
17 | 17 |
18 // Callback to be used when switching to a new profile is completed. | 18 // Callback to be used when switching to a new profile is completed. |
19 typedef base::Callback<void()> ProfileSwitchingDoneCallback; | 19 typedef base::Callback<void()> ProfileSwitchingDoneCallback; |
20 | 20 |
| 21 // Different tutorials that can be displayed in the user manager. |
| 22 enum UserManagerTutorialMode { |
| 23 USER_MANAGER_NO_TUTORIAL, // Does not display a tutorial. |
| 24 USER_MANAGER_TUTORIAL_OVERVIEW, // Basic overview of new features. |
| 25 USER_MANAGER_TUTORIAL_LOCK, // TODO(noms): To be implemented. |
| 26 }; |
| 27 |
21 // Activates a window for |profile| on the desktop specified by | 28 // Activates a window for |profile| on the desktop specified by |
22 // |desktop_type|. If no such window yet exists, or if |always_create| is | 29 // |desktop_type|. If no such window yet exists, or if |always_create| is |
23 // true, this first creates a new window, then activates | 30 // true, this first creates a new window, then activates |
24 // that. If activating an exiting window and multiple windows exists then the | 31 // that. If activating an exiting window and multiple windows exists then the |
25 // window that was most recently active is activated. This is used for | 32 // window that was most recently active is activated. This is used for |
26 // creation of a window from the multi-profile dropdown menu. | 33 // creation of a window from the multi-profile dropdown menu. |
27 void FindOrCreateNewWindowForProfile( | 34 void FindOrCreateNewWindowForProfile( |
28 Profile* profile, | 35 Profile* profile, |
29 chrome::startup::IsProcessStartup process_startup, | 36 chrome::startup::IsProcessStartup process_startup, |
30 chrome::startup::IsFirstRun is_first_run, | 37 chrome::startup::IsFirstRun is_first_run, |
(...skipping 21 matching lines...) Expand all Loading... |
52 void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type, | 59 void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type, |
53 ProfileSwitchingDoneCallback callback, | 60 ProfileSwitchingDoneCallback callback, |
54 ProfileMetrics::ProfileAdd metric); | 61 ProfileMetrics::ProfileAdd metric); |
55 | 62 |
56 // Closes all browser windows that belong to the guest profile. | 63 // Closes all browser windows that belong to the guest profile. |
57 void CloseGuestProfileWindows(); | 64 void CloseGuestProfileWindows(); |
58 | 65 |
59 // Closes all the browser windows for |profile| and opens the user manager. | 66 // Closes all the browser windows for |profile| and opens the user manager. |
60 void LockProfile(Profile* profile); | 67 void LockProfile(Profile* profile); |
61 | 68 |
| 69 // Creates or reuses the guest profile needed by the user manager. Based on |
| 70 // the value of |tutorial_mode|, the user manager can show a specific |
| 71 // tutorial, or no tutorial at all. If a tutorial is not shown, then |
| 72 // |profile_path_to_focus| could be used to specify which user should be |
| 73 // focused. |callback| is run with the custom url to be displayed, as well as |
| 74 // a pointer to the guest profile. |
| 75 void CreateGuestProfileForUserManager( |
| 76 const base::FilePath& profile_path_to_focus, |
| 77 profiles::UserManagerTutorialMode tutorial_mode, |
| 78 const base::Callback<void(Profile*, const std::string&)>& callback); |
| 79 |
| 80 // Based on the |profile| preferences, determines whether a user manager |
| 81 // tutorial needs to be shown, and displays the user manager with or without |
| 82 // the tutorial. |
| 83 void ShowUserManagerMaybeWithTutorial(Profile* profile); |
| 84 |
62 } // namespace profiles | 85 } // namespace profiles |
63 | 86 |
64 #endif // CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ | 87 #endif // CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ |
OLD | NEW |