Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / profiles / profile_window.h
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.
4
5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_
7
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"
12
13 class Profile;
14 namespace base { class FilePath; }
15
16 namespace profiles {
17
18 // Callback to be used when switching to a new profile is completed.
19 typedef base::Callback<void()> ProfileSwitchingDoneCallback;
20
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(
28     Profile* profile,
29     chrome::startup::IsProcessStartup process_startup,
30     chrome::startup::IsFirstRun is_first_run,
31     chrome::HostDesktopType desktop_type,
32     bool always_create);
33
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.
38
39 void SwitchToProfile(const base::FilePath& path,
40                      chrome::HostDesktopType desktop_type,
41                      bool always_create,
42                      ProfileSwitchingDoneCallback callback,
43                      ProfileMetrics::ProfileOpen metric);
44
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);
48
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);
55
56 // Closes all browser windows that belong to the guest profile.
57 void CloseGuestProfileWindows();
58
59 // Closes all the browser windows for |profile| and opens the user manager.
60 void LockProfile(Profile* profile);
61
62 }  // namespace profiles
63
64 #endif  // CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_