Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / profiles / user_manager_mac.h
blob662cd4c7ce4aadc1e1cbe8ed0ed3376893804211
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_COCOA_PROFILES_USER_MANAGER_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_PROFILES_USER_MANAGER_MAC_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/profiles/profile_window.h"
15 @class ReauthDialogWindowController;
16 @class UserManagerWindowController;
18 namespace content {
19 class NavigationController;
20 class WebContents;
23 // Dialog widget that contains the Desktop User Manager webui. This object
24 // should always be created from the UserManager::Show() method. Note that only
25 // one User Manager will exist at a time.
26 class UserManagerMac {
27 public:
28 // Called by the cocoa window controller when its window closes and the
29 // controller destroyed itself. Deletes the instance.
30 void WindowWasClosed();
32 // Called from the UserManager class once the |system_profile| is ready. Will
33 // construct a UserManagerMac object and show |url|.
34 static void OnSystemProfileCreated(const base::Time& start_time,
35 Profile* system_profile,
36 const std::string& url);
38 UserManagerWindowController* window_controller() {
39 return window_controller_.get();
42 void set_user_manager_started_showing(
43 const base::Time& user_manager_started_showing) {
44 user_manager_started_showing_ = user_manager_started_showing;
47 void LogTimeToOpen();
49 void ShowReauthDialog(content::BrowserContext* browser_context,
50 const std::string& email);
51 void CloseReauthDialog();
53 private:
54 explicit UserManagerMac(Profile* profile);
55 virtual ~UserManagerMac();
57 // Controller of the window.
58 base::scoped_nsobject<UserManagerWindowController> window_controller_;
60 base::scoped_nsobject<ReauthDialogWindowController> reauth_window_;
62 base::Time user_manager_started_showing_;
64 DISALLOW_COPY_AND_ASSIGN(UserManagerMac);
67 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_USER_MANAGER_MAC_H_