Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / views / profiles / user_manager_view.h
blob7554b4723db9f3b5efb8780a9a2c4a6ab3e6cf5b
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 "base/memory/scoped_ptr.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_window.h"
11 #include "ui/views/window/dialog_delegate.h"
13 class AutoKeepAlive;
15 namespace views {
16 class WebView;
19 // Dialog widget that contains the Desktop User Manager webui.
20 class UserManagerView : public views::DialogDelegateView {
21 public:
22 // Do not call directly. To display the User Manager, use UserManager::Show().
23 UserManagerView();
25 // Creates a new UserManagerView instance for the |system_profile| and shows
26 // the |url|.
27 static void OnSystemProfileCreated(scoped_ptr<UserManagerView> instance,
28 Profile* system_profile,
29 const std::string& url);
31 void set_user_manager_started_showing(
32 const base::Time& user_manager_started_showing) {
33 user_manager_started_showing_ = user_manager_started_showing;
36 // Logs how long it took the UserManager to open.
37 void LogTimeToOpen();
39 private:
40 ~UserManagerView() override;
42 friend struct base::DefaultDeleter<UserManagerView>;
44 // Creates dialog and initializes UI.
45 void Init(Profile* guest_profile, const GURL& url);
47 // views::View:
48 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
49 gfx::Size GetPreferredSize() const override;
51 // views::DialogDelegateView:
52 bool CanResize() const override;
53 bool CanMaximize() const override;
54 bool CanMinimize() const override;
55 base::string16 GetWindowTitle() const override;
56 int GetDialogButtons() const override;
57 void WindowClosing() override;
58 bool UseNewStyleForThisDialog() const override;
60 views::WebView* web_view_;
62 scoped_ptr<AutoKeepAlive> keep_alive_;
63 base::Time user_manager_started_showing_;
65 DISALLOW_COPY_AND_ASSIGN(UserManagerView);
68 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_