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

Unified Diff: chrome/browser/ui/webui/signin/login_ui_service.h

Issue 9295044: Start moving signin code out of browser/sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit test Created 8 years, 10 months 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/webui/signin/login_ui_service.h
diff --git a/chrome/browser/ui/webui/signin/login_ui_service.h b/chrome/browser/ui/webui/signin/login_ui_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..61f0c9fe64409a9dc037af0a6468bbe56191f4ca
--- /dev/null
+++ b/chrome/browser/ui/webui/signin/login_ui_service.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 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_WEBUI_SIGNIN_LOGIN_UI_SERVICE_H_
+#define CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_SERVICE_H_
+#pragma once
+
+#include "chrome/browser/profiles/profile_keyed_service.h"
+
+class Profile;
+
+namespace content {
+class WebUI;
+};
+
+// The LoginUIService helps track per-profile information for the login UI -
+// for example, whether there is login UI currently on-screen.
+class LoginUIService : public ProfileKeyedService {
+ public:
+ explicit LoginUIService(Profile* profile);
James Hawkins 2012/02/10 23:08:01 Document |profile|.
Andrew T Wilson (Slow) 2012/02/11 01:50:45 Done.
+ virtual ~LoginUIService();
+
+ // Gets the currently active login UI, or null if no login UI is active.
+ content::WebUI* current_login_ui() const {
+ return ui_;
+ }
+
+ // Sets the currently active login UI. It is illegal to call this if there is
+ // already login UI visible.
+ void SetLoginUI(content::WebUI* ui);
+
+ // If the passed UI is the current login UI, clears it (called when login UI
+ // is being shut down).
+ void ClearLoginUI(content::WebUI* ui);
James Hawkins 2012/02/10 23:08:01 s/Clear/Reset/ may be clearer given that we're ref
Andrew T Wilson (Slow) 2012/02/11 01:50:45 Done.
+
+ // Brings the current login UI for this profile to the foreground (it is an
+ // error to call this if there is no visible login UI.
+ void FocusLoginUI();
+
+ // Displays the login dialog to the user.
+ void ShowLoginUI();
+
+ private:
+ // The currently active login UI, or null if none.
+ content::WebUI* ui_;
James Hawkins 2012/02/10 23:08:01 Document ownership (likely weak ptr).
Andrew T Wilson (Slow) 2012/02/11 01:50:45 Done.
+
+ // The profile this service is associated with.
+ Profile* profile_;
+};
+
+
+#endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698