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 "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
11 #include "chrome/browser/profiles/profile_metrics.h" | 11 #include "chrome/browser/profiles/profile_metrics.h" |
12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
13 #include "chrome/browser/ui/profile_chooser_constants.h" | 13 #include "chrome/browser/ui/profile_chooser_constants.h" |
14 #include "chrome/browser/ui/startup/startup_types.h" | 14 #include "chrome/browser/ui/startup/startup_types.h" |
15 | 15 |
16 class Profile; | 16 class Profile; |
17 namespace base { class FilePath; } | 17 namespace base { class FilePath; } |
18 | 18 |
19 namespace profiles { | 19 namespace profiles { |
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 | |
28 // Different actions to perform after the user manager selects a profile as well | 21 // Different actions to perform after the user manager selects a profile as well |
29 // as actions to perform when user manager window opens. The former have a | 22 // as actions to perform when user manager window opens. The former have a |
30 // USER_MANAGER_SELECT_PROFILE_ prefix and the later a USER_MANAGER_OPEN_ | 23 // USER_MANAGER_SELECT_PROFILE_ prefix and the later a USER_MANAGER_OPEN_ |
31 // prefix. | 24 // prefix. |
32 enum UserManagerAction { | 25 enum UserManagerAction { |
33 USER_MANAGER_OPEN_CREATE_USER_PAGE, | 26 USER_MANAGER_OPEN_CREATE_USER_PAGE, |
34 USER_MANAGER_SELECT_PROFILE_NO_ACTION, | 27 USER_MANAGER_SELECT_PROFILE_NO_ACTION, |
35 USER_MANAGER_SELECT_PROFILE_TASK_MANAGER, | 28 USER_MANAGER_SELECT_PROFILE_TASK_MANAGER, |
36 USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME, | 29 USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME, |
37 USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS, | 30 USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS, |
38 USER_MANAGER_SELECT_PROFILE_APP_LAUNCHER, | 31 USER_MANAGER_SELECT_PROFILE_APP_LAUNCHER, |
39 }; | 32 }; |
40 | 33 |
41 extern const char kUserManagerDisplayTutorial[]; | |
42 extern const char kUserManagerOpenCreateUserPage[]; | 34 extern const char kUserManagerOpenCreateUserPage[]; |
43 extern const char kUserManagerSelectProfileTaskManager[]; | 35 extern const char kUserManagerSelectProfileTaskManager[]; |
44 extern const char kUserManagerSelectProfileAboutChrome[]; | 36 extern const char kUserManagerSelectProfileAboutChrome[]; |
45 extern const char kUserManagerSelectProfileChromeSettings[]; | 37 extern const char kUserManagerSelectProfileChromeSettings[]; |
46 extern const char kUserManagerSelectProfileAppLauncher[]; | 38 extern const char kUserManagerSelectProfileAppLauncher[]; |
47 | 39 |
48 // Returns the path of the profile connected to the given email. If no profile | 40 // Returns the path of the profile connected to the given email. If no profile |
49 // is found an empty file path is returned. | 41 // is found an empty file path is returned. |
50 base::FilePath GetPathOfProfileWithEmail(ProfileManager* profile_manager, | 42 base::FilePath GetPathOfProfileWithEmail(ProfileManager* profile_manager, |
51 const std::string& email); | 43 const std::string& email); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // Closes and locks all the browser windows for |profile| and opens the user | 102 // Closes and locks all the browser windows for |profile| and opens the user |
111 // manager. | 103 // manager. |
112 void LockProfile(Profile* profile); | 104 void LockProfile(Profile* profile); |
113 | 105 |
114 // Close all the browser windows for |profile| and opens the user manager. | 106 // Close all the browser windows for |profile| and opens the user manager. |
115 void CloseProfileWindows(Profile* profile); | 107 void CloseProfileWindows(Profile* profile); |
116 | 108 |
117 // Returns whether lock is available to this profile. | 109 // Returns whether lock is available to this profile. |
118 bool IsLockAvailable(Profile* profile); | 110 bool IsLockAvailable(Profile* profile); |
119 | 111 |
120 // Creates or reuses the system profile needed by the user manager. Based on | 112 // Creates or reuses the system profile needed by the user manager. |
121 // the value of |tutorial_mode|, the user manager can show a specific | |
122 // tutorial, or no tutorial at all. If a tutorial is not shown, then | |
123 // |profile_path_to_focus| could be used to specify which user should be | 113 // |profile_path_to_focus| could be used to specify which user should be |
124 // focused. Depending on the value of |user_manager_action|, executes an action | 114 // focused. Depending on the value of |user_manager_action|, executes an action |
125 // once the user manager displays or after a profile is opened. |callback| is | 115 // once the user manager displays or after a profile is opened. |callback| is |
126 // run with the custom url to be displayed, as well as a pointer to the guest | 116 // run with the custom url to be displayed, as well as a pointer to the guest |
127 // profile. | 117 // profile. |
128 void CreateSystemProfileForUserManager( | 118 void CreateSystemProfileForUserManager( |
129 const base::FilePath& profile_path_to_focus, | 119 const base::FilePath& profile_path_to_focus, |
130 profiles::UserManagerTutorialMode tutorial_mode, | |
131 profiles::UserManagerAction user_manager_action, | 120 profiles::UserManagerAction user_manager_action, |
132 const base::Callback<void(Profile*, const std::string&)>& callback); | 121 const base::Callback<void(Profile*, const std::string&)>& callback); |
133 | 122 |
134 // Based on the |profile| preferences, determines whether a user manager | |
135 // tutorial needs to be shown, and displays the user manager with or without | |
136 // the tutorial. | |
137 void ShowUserManagerMaybeWithTutorial(Profile* profile); | |
138 | |
139 // Converts from modes in the avatar menu to modes understood by | 123 // Converts from modes in the avatar menu to modes understood by |
140 // ProfileChooserView. | 124 // ProfileChooserView. |
141 void BubbleViewModeFromAvatarBubbleMode( | 125 void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode, |
142 BrowserWindow::AvatarBubbleMode mode, | 126 BubbleViewMode* bubble_view_mode); |
143 BubbleViewMode* bubble_view_mode, | |
144 TutorialMode* tutorial_mode); | |
145 | |
146 // Returns true if the Welcome/Upgrade tutorial bubble should be shown to the | |
147 // user, false otherwise. | |
148 bool ShouldShowWelcomeUpgradeTutorial( | |
149 Profile* profile, TutorialMode tutorial_mode); | |
150 | 127 |
151 } // namespace profiles | 128 } // namespace profiles |
152 | 129 |
153 #endif // CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ | 130 #endif // CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ |
OLD | NEW |