Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: chrome/browser/profiles/profile_window.h

Issue 564453003: Access to Chrome via the System Tray should go through the User Manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase continued Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_manager.h"
9 #include "chrome/browser/profiles/profile_metrics.h" 10 #include "chrome/browser/profiles/profile_metrics.h"
10 #include "chrome/browser/ui/browser_window.h" 11 #include "chrome/browser/ui/browser_window.h"
11 #include "chrome/browser/ui/host_desktop.h" 12 #include "chrome/browser/ui/host_desktop.h"
12 #include "chrome/browser/ui/profile_chooser_constants.h" 13 #include "chrome/browser/ui/profile_chooser_constants.h"
13 #include "chrome/browser/ui/startup/startup_types.h" 14 #include "chrome/browser/ui/startup/startup_types.h"
14 15
15 class Profile; 16 class Profile;
16 namespace base { class FilePath; } 17 namespace base { class FilePath; }
17 18
18 namespace profiles { 19 namespace profiles {
19 20
20 // Callback to be used when switching to a new profile is completed.
21 typedef base::Callback<void()> ProfileSwitchingDoneCallback;
22
23 // Different tutorials that can be displayed in the user manager. 21 // Different tutorials that can be displayed in the user manager.
24 enum UserManagerTutorialMode { 22 enum UserManagerTutorialMode {
25 USER_MANAGER_NO_TUTORIAL, // Does not display a tutorial. 23 USER_MANAGER_NO_TUTORIAL, // Does not display a tutorial.
26 USER_MANAGER_TUTORIAL_OVERVIEW, // Basic overview of new features. 24 USER_MANAGER_TUTORIAL_OVERVIEW, // Basic overview of new features.
27 USER_MANAGER_TUTORIAL_LOCK, // TODO(noms): To be implemented. 25 USER_MANAGER_TUTORIAL_LOCK, // TODO(noms): To be implemented.
28 }; 26 };
29 27
28 // Different actions to perform after the user manager selects a profile.
29 enum UserManagerProfileSelected {
30 USER_MANAGER_SELECT_PROFILE_NO_ACTION,
31 USER_MANAGER_SELECT_PROFILE_TASK_MANAGER,
32 USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME,
33 };
34
35 extern const char kUserManagerDisplayTutorial[];
36 extern const char kUserManagerSelectProfileTaskManager[];
37 extern const char kUserManagerSelectProfileAboutChrome[];
38
30 // Activates a window for |profile| on the desktop specified by 39 // Activates a window for |profile| on the desktop specified by
31 // |desktop_type|. If no such window yet exists, or if |always_create| is 40 // |desktop_type|. If no such window yet exists, or if |always_create| is
32 // true, this first creates a new window, then activates 41 // true, this first creates a new window, then activates
33 // that. If activating an exiting window and multiple windows exists then the 42 // that. If activating an exiting window and multiple windows exists then the
34 // window that was most recently active is activated. This is used for 43 // window that was most recently active is activated. This is used for
35 // creation of a window from the multi-profile dropdown menu. 44 // creation of a window from the multi-profile dropdown menu.
36 void FindOrCreateNewWindowForProfile( 45 void FindOrCreateNewWindowForProfile(
37 Profile* profile, 46 Profile* profile,
38 chrome::startup::IsProcessStartup process_startup, 47 chrome::startup::IsProcessStartup process_startup,
39 chrome::startup::IsFirstRun is_first_run, 48 chrome::startup::IsFirstRun is_first_run,
40 chrome::HostDesktopType desktop_type, 49 chrome::HostDesktopType desktop_type,
41 bool always_create); 50 bool always_create);
42 51
43 // Opens a Browser with the specified profile given by |path|. 52 // Opens a Browser with the specified profile given by |path|.
44 // If |always_create| is true then a new window is created 53 // If |always_create| is true then a new window is created
45 // even if a window for that profile already exists. When the browser is 54 // even if a window for that profile already exists. When the browser is
46 // opened, |callback| will be run if it isn't null. 55 // opened, |callback| will be run if it isn't null.
47 56
48 void SwitchToProfile(const base::FilePath& path, 57 void SwitchToProfile(const base::FilePath& path,
49 chrome::HostDesktopType desktop_type, 58 chrome::HostDesktopType desktop_type,
50 bool always_create, 59 bool always_create,
51 ProfileSwitchingDoneCallback callback, 60 ProfileManager::CreateCallback callback,
52 ProfileMetrics::ProfileOpen metric); 61 ProfileMetrics::ProfileOpen metric);
53 62
54 // Opens a Browser for the guest profile and runs |callback| if it isn't null. 63 // Opens a Browser for the guest profile and runs |callback| if it isn't null.
55 void SwitchToGuestProfile(chrome::HostDesktopType desktop_type, 64 void SwitchToGuestProfile(chrome::HostDesktopType desktop_type,
56 ProfileSwitchingDoneCallback callback); 65 ProfileManager::CreateCallback callback);
57 66
58 // Creates a new profile from the next available profile directory, and 67 // Creates a new profile from the next available profile directory, and
59 // opens a new browser window for the profile once it is ready. When the browser 68 // opens a new browser window for the profile once it is ready. When the browser
60 // is opened, |callback| will be run if it isn't null. 69 // is opened, |callback| will be run if it isn't null.
61 void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type, 70 void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type,
62 ProfileSwitchingDoneCallback callback, 71 ProfileManager::CreateCallback callback,
63 ProfileMetrics::ProfileAdd metric); 72 ProfileMetrics::ProfileAdd metric);
64 73
65 // Closes all browser windows that belong to the guest profile. 74 // Closes all browser windows that belong to the guest profile.
66 void CloseGuestProfileWindows(); 75 void CloseGuestProfileWindows();
67 76
68 // Closes all the browser windows for |profile| and opens the user manager. 77 // Closes all the browser windows for |profile| and opens the user manager.
69 void LockProfile(Profile* profile); 78 void LockProfile(Profile* profile);
70 79
71 // Creates or reuses the guest profile needed by the user manager. Based on 80 // Creates or reuses the guest profile needed by the user manager. Based on
72 // the value of |tutorial_mode|, the user manager can show a specific 81 // the value of |tutorial_mode|, the user manager can show a specific
73 // tutorial, or no tutorial at all. If a tutorial is not shown, then 82 // tutorial, or no tutorial at all. If a tutorial is not shown, then
74 // |profile_path_to_focus| could be used to specify which user should be 83 // |profile_path_to_focus| could be used to specify which user should be
75 // focused. |callback| is run with the custom url to be displayed, as well as 84 // focused. After a profile is opened from the user manager, perform
76 // a pointer to the guest profile. 85 // |profile_open_action|. |callback| is run with the custom url to be displayed,
86 // as well as a pointer to the guest profile.
77 void CreateGuestProfileForUserManager( 87 void CreateGuestProfileForUserManager(
78 const base::FilePath& profile_path_to_focus, 88 const base::FilePath& profile_path_to_focus,
79 profiles::UserManagerTutorialMode tutorial_mode, 89 profiles::UserManagerTutorialMode tutorial_mode,
90 profiles::UserManagerProfileSelected profile_open_action,
80 const base::Callback<void(Profile*, const std::string&)>& callback); 91 const base::Callback<void(Profile*, const std::string&)>& callback);
81 92
82 // Based on the |profile| preferences, determines whether a user manager 93 // Based on the |profile| preferences, determines whether a user manager
83 // tutorial needs to be shown, and displays the user manager with or without 94 // tutorial needs to be shown, and displays the user manager with or without
84 // the tutorial. 95 // the tutorial.
85 void ShowUserManagerMaybeWithTutorial(Profile* profile); 96 void ShowUserManagerMaybeWithTutorial(Profile* profile);
86 97
87 // Enables new profile management preview and shows the user manager tutorial. 98 // Enables new profile management preview and shows the user manager tutorial.
88 void EnableNewProfileManagementPreview(Profile* profile); 99 void EnableNewProfileManagementPreview(Profile* profile);
89 100
90 // Disables new profile management preview and attempts to relaunch Chrome. 101 // Disables new profile management preview and attempts to relaunch Chrome.
91 void DisableNewProfileManagementPreview(Profile* profile); 102 void DisableNewProfileManagementPreview(Profile* profile);
92 103
93 // Converts from modes in the avatar menu to modes understood by 104 // Converts from modes in the avatar menu to modes understood by
94 // ProfileChooserView. 105 // ProfileChooserView.
95 void BubbleViewModeFromAvatarBubbleMode( 106 void BubbleViewModeFromAvatarBubbleMode(
96 BrowserWindow::AvatarBubbleMode mode, 107 BrowserWindow::AvatarBubbleMode mode,
97 BubbleViewMode* bubble_view_mode, 108 BubbleViewMode* bubble_view_mode,
98 TutorialMode* tutorial_mode); 109 TutorialMode* tutorial_mode);
99 110
100 } // namespace profiles 111 } // namespace profiles
101 112
102 #endif // CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ 113 #endif // CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_manager_browsertest.cc ('k') | chrome/browser/profiles/profile_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698