Refactor views app list services to allow more code sharing
[chromium-blink-merge.git] / chrome / browser / ui / views / profiles / user_manager_view.h
blob39230bfc0805fb79866466f9355b3485ee9007e8
1 // Copyright 2014 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_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_window.h"
10 #include "ui/views/window/dialog_delegate.h"
12 class AutoKeepAlive;
14 namespace views {
15 class WebView;
18 // Dialog widget that contains the Desktop User Manager webui.
19 class UserManagerView : public views::DialogDelegateView {
20 public:
21 // Shows the User Manager or re-activates an existing one, focusing the
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);
28 // Hide the User Manager.
29 static void Hide();
31 // Returns whether or not the User Manager is showing.
32 static bool IsShowing();
34 private:
35 explicit UserManagerView(Profile* profile);
36 virtual ~UserManagerView();
38 // Creates a new UserManagerView instance for the |guest_profile| and
39 // shows the |url|.
40 static void OnGuestProfileCreated(Profile* guest_profile,
41 const std::string& url);
43 // views::View:
44 virtual gfx::Size GetPreferredSize() OVERRIDE;
46 // views::DialogDelegateView:
47 virtual bool CanResize() const OVERRIDE;
48 virtual bool CanMaximize() const OVERRIDE;
49 virtual base::string16 GetWindowTitle() const OVERRIDE;
50 virtual int GetDialogButtons() const OVERRIDE;
51 virtual void WindowClosing() OVERRIDE;
52 virtual bool UseNewStyleForThisDialog() const OVERRIDE;
54 views::WebView* web_view_;
56 scoped_ptr<AutoKeepAlive> keep_alive_;
57 // An open User Manager window. There can only be one open at a time. This
58 // is reset to NULL when the window is closed.
59 static UserManagerView* instance_;
61 DISALLOW_COPY_AND_ASSIGN(UserManagerView);
64 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_