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_UI_VIEWS_USER_MANAGER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_USER_MANAGER_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_USER_MANAGER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_USER_MANAGER_VIEW_H_ |
7 | 7 |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/profiles/profile_window.h" | |
9 #include "ui/views/window/dialog_delegate.h" | 10 #include "ui/views/window/dialog_delegate.h" |
10 | 11 |
11 class AutoKeepAlive; | 12 class AutoKeepAlive; |
12 | 13 |
13 namespace views { | 14 namespace views { |
14 class WebView; | 15 class WebView; |
15 } | 16 } |
16 | 17 |
17 // Dialog widget that contains the Desktop User Manager webui. | 18 // Dialog widget that contains the Desktop User Manager webui. |
18 class UserManagerView : public views::DialogDelegateView { | 19 class UserManagerView : public views::DialogDelegateView { |
19 public: | 20 public: |
20 // Shows the User Manager or re-activates an existing one. | 21 // Shows the User Manager or re-activates an existing one, focusing the |
21 static void Show(const base::FilePath& profile_path_to_focus); | 22 // profile given by |profile_path_to_focus|. Based on the value of |
23 // |tutorial_mode|, a tutorial could be shown, in which case | |
24 // |profile_path_to_focus| is ignored. | |
25 static void Show(const base::FilePath& profile_path_to_focus, | |
26 profiles::UserManagerTutorialMode tutorial_mode); | |
22 | 27 |
23 // Hide the User Manager. | 28 // Hide the User Manager. |
24 static void Hide(); | 29 static void Hide(); |
25 | 30 |
26 // Returns whether or not the User Manager is showing. | 31 // Returns whether or not the User Manager is showing. |
27 static bool IsShowing(); | 32 static bool IsShowing(); |
28 | 33 |
29 private: | 34 private: |
30 explicit UserManagerView(Profile* profile); | 35 explicit UserManagerView(Profile* profile); |
31 virtual ~UserManagerView(); | 36 virtual ~UserManagerView(); |
32 | 37 |
33 // If the |guest_profile| has been initialized succesfully (according to | 38 // If the |guest_profile| has been initialized succesfully (according to |
34 // |status|), creates a new UserManagerView instance with the user with path | 39 // |status|), creates a new UserManagerView instance and shows the |url|. |
msw
2014/03/20 18:51:26
nit: |status| no longer exists, please update the
noms (inactive)
2014/03/20 20:28:20
Done here and in the mac version. On 2014/03/20 18
| |
35 // |profile_path_to_focus| focused. | 40 static void OnGuestProfileCreated(Profile* guest_profile, |
36 static void OnGuestProfileCreated(const base::FilePath& profile_path_to_focus, | 41 const std::string& url); |
37 Profile* guest_profile, | |
38 Profile::CreateStatus status); | |
39 | 42 |
40 // views::View: | 43 // views::View: |
41 virtual gfx::Size GetPreferredSize() OVERRIDE; | 44 virtual gfx::Size GetPreferredSize() OVERRIDE; |
42 | 45 |
43 // views::DialogDelegateView: | 46 // views::DialogDelegateView: |
44 virtual bool CanResize() const OVERRIDE; | 47 virtual bool CanResize() const OVERRIDE; |
45 virtual bool CanMaximize() const OVERRIDE; | 48 virtual bool CanMaximize() const OVERRIDE; |
46 virtual base::string16 GetWindowTitle() const OVERRIDE; | 49 virtual base::string16 GetWindowTitle() const OVERRIDE; |
47 virtual int GetDialogButtons() const OVERRIDE; | 50 virtual int GetDialogButtons() const OVERRIDE; |
48 virtual void WindowClosing() OVERRIDE; | 51 virtual void WindowClosing() OVERRIDE; |
49 virtual bool UseNewStyleForThisDialog() const OVERRIDE; | 52 virtual bool UseNewStyleForThisDialog() const OVERRIDE; |
50 | 53 |
51 views::WebView* web_view_; | 54 views::WebView* web_view_; |
52 | 55 |
53 scoped_ptr<AutoKeepAlive> keep_alive_; | 56 scoped_ptr<AutoKeepAlive> keep_alive_; |
54 // An open User Manager window. There can only be one open at a time. This | 57 // An open User Manager window. There can only be one open at a time. This |
55 // is reset to NULL when the window is closed. | 58 // is reset to NULL when the window is closed. |
56 static UserManagerView* instance_; | 59 static UserManagerView* instance_; |
57 | 60 |
58 DISALLOW_COPY_AND_ASSIGN(UserManagerView); | 61 DISALLOW_COPY_AND_ASSIGN(UserManagerView); |
59 }; | 62 }; |
60 | 63 |
61 #endif // CHROME_BROWSER_UI_VIEWS_USER_MANAGER_VIEW_H_ | 64 #endif // CHROME_BROWSER_UI_VIEWS_USER_MANAGER_VIEW_H_ |
OLD | NEW |