Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: chrome/browser/ui/cocoa/user_manager_mac.h

Issue 102913002: [Mac] User manager should show up as a standalone window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rachel comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/user_manager_mac.h
diff --git a/chrome/browser/ui/cocoa/user_manager_mac.h b/chrome/browser/ui/cocoa/user_manager_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..1a9465ab620a10e9393f4a9b33a181c1235ae5c3
--- /dev/null
+++ b/chrome/browser/ui/cocoa/user_manager_mac.h
@@ -0,0 +1,73 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_
+#define CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/mac/scoped_nsobject.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/profiles/profile.h"
+
+class UserManagerMac;
+
+namespace content {
+class NavigationController;
+class WebContents;
+}
+
+// Window controller for the User Manager view.
+@interface UserManagerWindowController : NSWindowController <NSWindowDelegate> {
+@private
Nico 2013/12/12 18:05:40 nit: I think we indent @private by 1
noms (inactive) 2013/12/12 22:59:23 Done.
+ scoped_ptr<content::WebContents> webContents_;
+ UserManagerMac* userManagerObserver_; // Weak.
+}
+
+- (id)initWithProfile:(Profile*) profile
Nico 2013/12/12 18:05:40 nit: no space between *) and p
noms (inactive) 2013/12/12 22:59:23 Gah. Done. On 2013/12/12 18:05:40, Nico wrote:
+ withObserver:(UserManagerMac*) userManagerObserver;
Nico 2013/12/12 18:05:40 (same here)
noms (inactive) 2013/12/12 22:59:23 Done.
+- (void)showURL:(const GURL&)url;
+- (void)show;
+- (void)close;
+@end
Nico 2013/12/12 18:05:40 nit: It looks like this class is only used in the
noms (inactive) 2013/12/12 22:59:23 Done.
+
+// Dialog widget that contains the Desktop User Manager webui.
+class UserManagerMac {
+ public:
+ // Shows the User Manager or re-activates an existing one, focusing the
+ // profile given by |profile_path_to_focus|.
+ static void Show(const base::FilePath& profile_path_to_focus);
+
+ // Hide the User Manager.
+ static void Hide();
+
+ // Returns whether or not the User Manager is showing.
+ static bool IsShowing();
+
+ // Called by the cocoa window controller when its window closes and the
+ // controller destroyed itself. Deletes the instance.
+ void WindowWasClosed();
+
+ private:
+ explicit UserManagerMac(Profile* profile);
+ virtual ~UserManagerMac();
+
+ // If the |guest_profile| has been initialized succesfully (according to
+ // |status|), creates a new UserManagerMac instance with the user with path
+ // |profile_path_to_focus| focused.
+ static void OnGuestProfileCreated(const base::FilePath& profile_path_to_focus,
+ Profile* guest_profile,
+ Profile::CreateStatus status);
+
+ // An open User Manager window. There can only be one open at a time. This
+ // is reset to NULL when the window is closed.
+ static UserManagerMac* instance_; // Weak.
+
+ // Controller of the window.
+ base::scoped_nsobject<UserManagerWindowController> window_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(UserManagerMac);
+};
+
+#endif // CHROME_BROWSER_UI_COCOA_USER_MANAGER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698