[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / profiles / user_manager_mac.h
blob57786281043b8aa9d1dd01e87f1ae72455c56096
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 UserManagerMac;
16 @class UserManagerWindowController;
18 namespace content {
19 class NavigationController;
20 class WebContents;
23 // Dialog widget that contains the Desktop User Manager webui.
24 class UserManagerMac {
25 public:
26 // Shows the User Manager or re-activates an existing one, focusing the
27 // profile given by |profile_path_to_focus|. Based on the value of
28 // |tutorial_mode|, a tutorial could be shown, in which case
29 // |profile_path_to_focus| is ignored.
30 static void Show(const base::FilePath& profile_path_to_focus,
31 profiles::UserManagerTutorialMode tutorial_mode);
33 // Hide the User Manager.
34 static void Hide();
36 // Returns whether or not the User Manager is showing.
37 static bool IsShowing();
39 // Called by the cocoa window controller when its window closes and the
40 // controller destroyed itself. Deletes the instance.
41 void WindowWasClosed();
43 private:
44 explicit UserManagerMac(Profile* profile);
45 virtual ~UserManagerMac();
47 // Creates a new UserManagerMac instance for the |guest_profile| and
48 // shows the |url|.
49 static void OnGuestProfileCreated(Profile* guest_profile,
50 const std::string& url);
52 // An open User Manager window. There can only be one open at a time. This
53 // is reset to NULL when the window is closed.
54 static UserManagerMac* instance_; // Weak.
56 // Controller of the window.
57 base::scoped_nsobject<UserManagerWindowController> window_controller_;
59 DISALLOW_COPY_AND_ASSIGN(UserManagerMac);
62 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_USER_MANAGER_MAC_H_