| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_PROFILES_USER_MANAGER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/profile_window.h" | 13 #include "chrome/browser/profiles/profile_window.h" |
| 15 #include "ui/views/window/dialog_delegate.h" | 14 #include "ui/views/window/dialog_delegate.h" |
| 16 | 15 |
| 17 class ScopedKeepAlive; | 16 class ScopedKeepAlive; |
| 18 | 17 |
| 19 namespace views { | 18 namespace views { |
| 20 class WebView; | 19 class WebView; |
| 21 } | 20 } |
| 22 | 21 |
| 23 // Dialog widget that contains the Desktop User Manager webui. | 22 // Dialog widget that contains the Desktop User Manager webui. |
| 24 class UserManagerView : public views::DialogDelegateView { | 23 class UserManagerView : public views::DialogDelegateView { |
| 25 public: | 24 public: |
| 26 // Do not call directly. To display the User Manager, use UserManager::Show(). | 25 // Do not call directly. To display the User Manager, use UserManager::Show(). |
| 27 UserManagerView(); | 26 UserManagerView(); |
| 28 | 27 |
| 29 // Creates a new UserManagerView instance for the |system_profile| and shows | 28 // Creates a new UserManagerView instance for the |system_profile| and shows |
| 30 // the |url|. | 29 // the |url|. |
| 31 static void OnSystemProfileCreated(scoped_ptr<UserManagerView> instance, | 30 static void OnSystemProfileCreated(std::unique_ptr<UserManagerView> instance, |
| 32 base::AutoReset<bool>* pending, | 31 base::AutoReset<bool>* pending, |
| 33 Profile* system_profile, | 32 Profile* system_profile, |
| 34 const std::string& url); | 33 const std::string& url); |
| 35 | 34 |
| 36 void set_user_manager_started_showing( | 35 void set_user_manager_started_showing( |
| 37 const base::Time& user_manager_started_showing) { | 36 const base::Time& user_manager_started_showing) { |
| 38 user_manager_started_showing_ = user_manager_started_showing; | 37 user_manager_started_showing_ = user_manager_started_showing; |
| 39 } | 38 } |
| 40 | 39 |
| 41 // Logs how long it took the UserManager to open. | 40 // Logs how long it took the UserManager to open. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 57 bool CanResize() const override; | 56 bool CanResize() const override; |
| 58 bool CanMaximize() const override; | 57 bool CanMaximize() const override; |
| 59 bool CanMinimize() const override; | 58 bool CanMinimize() const override; |
| 60 base::string16 GetWindowTitle() const override; | 59 base::string16 GetWindowTitle() const override; |
| 61 int GetDialogButtons() const override; | 60 int GetDialogButtons() const override; |
| 62 void WindowClosing() override; | 61 void WindowClosing() override; |
| 63 bool UseNewStyleForThisDialog() const override; | 62 bool UseNewStyleForThisDialog() const override; |
| 64 | 63 |
| 65 views::WebView* web_view_; | 64 views::WebView* web_view_; |
| 66 | 65 |
| 67 scoped_ptr<ScopedKeepAlive> keep_alive_; | 66 std::unique_ptr<ScopedKeepAlive> keep_alive_; |
| 68 base::Time user_manager_started_showing_; | 67 base::Time user_manager_started_showing_; |
| 69 | 68 |
| 70 DISALLOW_COPY_AND_ASSIGN(UserManagerView); | 69 DISALLOW_COPY_AND_ASSIGN(UserManagerView); |
| 71 }; | 70 }; |
| 72 | 71 |
| 73 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_ | 72 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_USER_MANAGER_VIEW_H_ |
| OLD | NEW |