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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_
8 #include "base/callback_forward.h"
9 #include "chrome/browser/profiles/profile_metrics.h"
10 #include "chrome/browser/ui/host_desktop.h"
11 #include "chrome/browser/ui/startup/startup_types.h"
14 namespace base { class FilePath; }
18 // Callback to be used when switching to a new profile is completed.
19 typedef base::Callback<void()> ProfileSwitchingDoneCallback;
21 // Activates a window for |profile| on the desktop specified by
22 // |desktop_type|. If no such window yet exists, or if |always_create| is
23 // true, this first creates a new window, then activates
24 // 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
26 // creation of a window from the multi-profile dropdown menu.
27 void FindOrCreateNewWindowForProfile(
29 chrome::startup::IsProcessStartup process_startup,
30 chrome::startup::IsFirstRun is_first_run,
31 chrome::HostDesktopType desktop_type,
34 // Opens a Browser with the specified profile given by |path|.
35 // If |always_create| is true then a new window is created
36 // even if a window for that profile already exists. When the browser is
37 // opened, |callback| will be run if it isn't null.
39 void SwitchToProfile(const base::FilePath& path,
40 chrome::HostDesktopType desktop_type,
42 ProfileSwitchingDoneCallback callback,
43 ProfileMetrics::ProfileOpen metric);
45 // Opens a Browser for the guest profile and runs |callback| if it isn't null.
46 void SwitchToGuestProfile(chrome::HostDesktopType desktop_type,
47 ProfileSwitchingDoneCallback callback);
49 // Creates a new profile from the next available profile directory, and
50 // opens a new browser window for the profile once it is ready. When the browser
51 // is opened, |callback| will be run if it isn't null.
52 void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type,
53 ProfileSwitchingDoneCallback callback,
54 ProfileMetrics::ProfileAdd metric);
56 // Closes all browser windows that belong to the guest profile.
57 void CloseGuestProfileWindows();
59 // Closes all the browser windows for |profile| and opens the user manager.
60 void LockProfile(Profile* profile);
62 } // namespace profiles
64 #endif // CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_