Chromium Code Reviews| 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..2197970719bc8207eeb742ece15b7467fde34c95 |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/signin/login_ui_service.h |
| @@ -0,0 +1,59 @@ |
| +// 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 "base/basictypes.h" |
| +#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 { |
|
tim (not reviewing)
2012/02/14 17:22:29
So this class isn't meant to be used on all platfo
Andrew T Wilson (Slow)
2012/02/14 20:52:36
I'm not sure what you mean. Can you clarify? This
|
| + public: |
| + // Creates a LoginUIService associated with the passed |profile|. |profile| |
| + // is used to create a new browser in the case that ShowLoginUI() is invoked |
| + // when no browser windows are open (e.g. via the Mac menu bar). |
| + explicit LoginUIService(Profile* profile); |
| + 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, resets it (called when login UI |
| + // is being shut down). |
| + void ResetLoginUI(content::WebUI* ui); |
|
tim (not reviewing)
2012/02/14 17:22:29
I'm substantially confused about the difference be
Andrew T Wilson (Slow)
2012/02/14 20:52:36
Sigh, this used to be ClearLoginUI(), but jhawkins
|
| + |
| + // 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: |
| + // Weak pointer to the currently active login UI, or null if none. |
| + content::WebUI* ui_; |
| + |
| + // Weak pointer to the profile this service is associated with. |
| + Profile* profile_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LoginUIService); |
| +}; |
| + |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_SERVICE_H_ |